Read from a file that is continuously being updated

后端 未结 4 1580
野性不改
野性不改 2020-12-19 08:55

I am writing some C code to process some data in a file, but I just learned that the file is going to be constantly added to (about 1 time/second, maybe faster). So I\'m wo

4条回答
  •  独厮守ぢ
    2020-12-19 09:16

    You can use select() with the fileno(file) as the file-descriptor. select will return either with a timeout (if you set a timeout) or when you can read from the file.

提交回复
热议问题