winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
511 stars 82 forks source link

Add FileSystemHost.Preflight method #48

Open fgma opened 3 years ago

fgma commented 3 years ago

A call to mount should not panic when winfsp is not installed but return an error instead. This allows an application to handle this case gracefully.

https://github.com/billziss-gh/cgofuse/blob/45df47debffe20241cb2896905708913408d3152/fuse/host.go#L605-L612

As an alternative you could provide a public function that will allow to check winfsp/fuse availability before calling mount.

billziss-gh commented 3 years ago

The application may still handle this case by using recover(). In any case this cannot be changed, because the cgofuse interface cannot be changed in a backwards incompatible manner.

As an alternative you could provide a public function that will allow to check winfsp/fuse availability before calling mount.

I agree that having this capability may be worth adding. I will mark it as enhancement.