bindfs
bindfs copied to clipboard
Deal with source dir being deleted and recreated
When the source dir is deleted, bindfs should watch for it being created again and update its cwd.
Could be implemented as follows:
- Add an inotify watch on the cwd path.
- Check that the dir wasn't already deleted.
- Wait for
IN_DELETE_SELForIN_MOVE_SELF. - Periodically poll for the path to reappear, or make an inotify-based system, which takes volatile parent dirs into account (would probably be something like a recursive version of the present algorithm).
- When the path reappears,
fchdirinto it.
All this either in a new thread or use the low-level FUSE API and use async I/O with watches and the FUSE fd.
Could also be implemented as a separate watcher script.