linux - Locked file or directory in C -


I have a daemon that looks at a fixed file for changes, then processes the changes made in the file .

But now I've found that when I try to read the file (using the fests) I do not get any data, it only happened when the file was changed, even if I Any time I try to read the file, I can read it.

I think the file is locked in another process when I try to read it. How can I determine if the file is locked?

When fgets () returns zero for an EOF, To define the situation that you need to clean () () (The only common type of file locking on Linux is the consultant, so this is not most likely to be your problem. Probably a better solution to detect file changes .)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -