bindfs icon indicating copy to clipboard operation
bindfs copied to clipboard

Deal with source dir being deleted and recreated

Open mpartel opened this issue 12 years ago • 1 comments

When the source dir is deleted, bindfs should watch for it being created again and update its cwd.

Could be implemented as follows:

  1. Add an inotify watch on the cwd path.
  2. Check that the dir wasn't already deleted.
  3. Wait for IN_DELETE_SELF or IN_MOVE_SELF.
  4. 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).
  5. When the path reappears, fchdir into 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.

mpartel avatar Dec 20 '13 07:12 mpartel

Could also be implemented as a separate watcher script.

mpartel avatar Dec 20 '13 07:12 mpartel