I've written some simple filesystems with Python-fuse, but now I'm wanting to do something that I can't find in the pydoc nor in the sample scripts I've found: when the filesystem is unmounted with fusermount -u
, I want to trap that action, perform the umount, and then rmdir the mount directory created by my program's initialization script. If it is even possible, what's the magic incantation to trap the umount action?
I can see how that could easily turn into an endless loop, but I can hopefully figure out how to disable the umount trap the first time it's hit.
Update: I found
destroy
at http://omake.metaprl.org/prerelease/omake-dll-fuse.html#htoc582 and added the method, but it doesn't seem to be called.
found it! it's fsdestroy() in Python-fuse. located it by:
What I used was:
Don't know if the data parameter is necessary or not, but doesn't hurt. And apparently, it's called after the umount, so I didn't have to worry about handling that.