Read from a file that is continuously being updated

后端 未结 4 1579
野性不改
野性不改 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:19

    Using select can be a good choice but if you do not wish to use it, you can add a sleep for a small amount of milliseconds before reading value.

提交回复
热议问题