Closed ar- closed 9 years ago
I fail to see why using the find command through a system call is more stable than a native implementation?
What do you think of the algorithm proposed in the related Debian bug report[1][2]? (IMO, this is the way to go even if it requires more work that it looks to be)
[1] https://bugs.debian.org/443700 [2] https://mail.gnome.org/archives/dashboard-hackers/2004-October/msg00022.html
M.
The algorithm in [2] considered only the recursive creation on directories but not their deletion. Prevention race condiditions for all possible cases (also considering multiple users on the filesystem) is a very complex problem. I could not see that the algorithm in [2] solves the problem finally.
I decided for 2 reasons, to call find(), but I'm also aware that this is usually considered to be more like a 'hack' and it should be done in CPP.
Are there any practical concerns? Eg. is find() not available on some platforms? ARM? SPARC? Not sure about this.
find (the GNU version) is known to work on all architectures supported by Debian: https://www.debian.org/ports/
Watching a directory recursively is not nativlely supported by inotify and so it is not in incron. Even though is is hightly requested, and actually not too complicated to implement.
A possible python extension is here: https://github.com/nguyent/incron-recursive .
In 2013 the Author tried to get funding to implement this feature, whcih brought him 0 cents. That's one of the reasons why he abondenned the project.
Another alternative seems to be https://github.com/gregghz/Watcher .
Obeserving directories recursively, must be added to incron.