dongshui9690 2018-08-12 00:02
浏览 252
已采纳

Golang中的PHP fopen / fread / fwrite等效项

Is there an equivalent Php's fopen/fread/fwrite method in golang?

At the moment, I currently move, write and append to []byte with an offset, then write all thru os.File.Write(). But I'm wondering if there's a method that I can do directly to and from a file.

  • 写回答

1条回答 默认 最新

  • dongque20030402 2018-08-12 01:01
    关注

    fopen

    os.OpenFile https://golang.org/pkg/os/#OpenFile

    fread

    No identical match, but similer (*os.File)Read https://golang.org/pkg/os/#File.Read

    fwrite

    (*os.File)Write https://golang.org/pkg/os/#File.Write

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?