cberner / fuser

Filesystem in Userspace (FUSE) for Rust
MIT License
835 stars 114 forks source link

Make the mount field public #223

Closed LevitatingBusinessMan closed 1 year ago

LevitatingBusinessMan commented 1 year ago

This allows for unmounting a session running in a different thread, similar to BackgroundSessions behavior.

One issue with using BackgroundSession is that it require the filesystem to be bound by Send.

You can see the benefit Here.

cberner commented 1 year ago

I don't want to expose that field. But I think you can call umount from your ctrl-c handler and it will have the same effect

LevitatingBusinessMan commented 1 year ago

Good solution. That works, thanks.

LevitatingBusinessMan commented 1 year ago

Heh, on closer inspection it actually doesn't work. It returns -1.

It would be nice if you could add a way to automatically unmount the filesystem (which can't be sent across threads) without having to expose any private fields.

cberner commented 1 year ago

@LevitatingBusinessMan can you give this branch a try? https://github.com/cberner/fuser/pull/224

LevitatingBusinessMan commented 1 year ago

Looks very good, thanks for taking the time to work on this. I will try to find the time to test it tomorrow.

LevitatingBusinessMan commented 1 year ago

Hey, I forgot to test it in the weekend but I tested it now. It works like a charm.

See here

LevitatingBusinessMan commented 1 year ago

When will you publish the change to crates, then I can delete my fork from the repositories :)

cberner commented 1 year ago

I just released version 0.12.0