Nicolas Jean Nicolas Jean - 1 year ago 71
C Question

How to wait until a file is created in C

How can I stop the execution of a thread until a file is created ?

I would like to avoid doing it in a busy loop, and use something with a behavior similar to select(). Is something like this possible?

I only found ways to check if a file exists at a given time.

usr usr
Answer Source

You are probably looking for inotify(7). At the botton of the man page linked, there's example showing how to monitor for various events.