Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement -ignore_readdir_race and -noignore_readdir_race #377

Open
hanbings opened this issue May 11, 2024 · 0 comments · May be fixed by #411
Open

Implement -ignore_readdir_race and -noignore_readdir_race #377

hanbings opened this issue May 11, 2024 · 0 comments · May be fixed by #411

Comments

@hanbings
Copy link
Collaborator

refer: https://www.gnu.org/software/findutils/manual/html_node/find_html/Directories.html

Option: -ignore_readdir_race
If a file disappears after its name has been read from a directory but 
before find gets around to examining the file with stat, don’t issue an error message. 
If you don’t specify this option, an error message will be issued.

Furthermore, find with the ‘-ignore_readdir_race’ option will ignore errors of 
the ‘-delete’ action in the case the file has disappeared since the parent directory was read: 
it will not output an error diagnostic, and the return code of the ‘-delete’ action will be true.

This option can be useful in system scripts (cron scripts, for example) that examine areas of 
the filesystem that change frequently (mail queues, temporary directories, and so forth), 
because this scenario is common for those sorts of directories. 
Completely silencing error messages from find is undesirable, 
so this option neatly solves the problem. 
There is no way to search one part of the filesystem with this option on and 
part of it with this option off, though. 
When this option is turned on and find discovers that one of the start-point files specified on 
the command line does not exist, no error message will be issued.

Option: -noignore_readdir_race
This option reverses the effect of the ‘-ignore_readdir_race’ option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant