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

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

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试