How would I read a growing file in Go?

huangapple go评论82阅读模式
英文:

How would I read a growing file in Go?

问题

就像命令tail -f <一个增长的文件>一样吗?

每当我读取一个增长的文件时,总是遇到EOF错误,然后退出。

英文:

Just like the command tail -f &lt;a growing file&gt; ?

whenever I read a growing file, it always encounter the EOF error, and then quit.

答案1

得分: 6

我还没有进行过太多的实验,但有一个 GitHub 仓库旨在在 Go 中模拟 tail 功能:https://github.com/ActiveState/tail

英文:

I haven't experimented with it much, but there is a github repository that aims to emulate <code>tail</code> functionality in Go: https://github.com/ActiveState/tail

答案2

得分: 0

在Linux上以C语言编程的情况下,找到答案,然后使用相同或类似的选项来调用等效的"open"系统调用。

英文:

Find the answer as if you're programming in C on Linux, then use the same/analogous options to the equivalent 'open' system call.

huangapple
  • 本文由 发表于 2013年10月16日 23:27:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/19407502.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定