I'm writing pure C application which should be able to traverse some directory recursively. When I set /
as this directory and application starts at some time I get fails of lstat()
- I get list of nodes in directory and later when I'm doing lstat()
on some of these nodes it fails. This often happens in /proc
filesystem.
I know that this is dynamic filesystem which could be changed very often.
How can I traverse these filesystems? When at any time getting snapshot (nodes of directory) can be different from real state of filesystem.
Also find / -iname "*"
doesn't fails and shows files including inside /proc
.