Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mounting to non-existing mount points #73

Closed
overheadhunter opened this issue Feb 6, 2019 · 1 comment
Closed

Allow mounting to non-existing mount points #73

overheadhunter opened this issue Feb 6, 2019 · 1 comment

Comments

@overheadhunter
Copy link
Contributor

During an attempt to mount, jnr-fuse checks whether the mount point is an existing directory. If it is not, an exception is thrown:

ru.serce.jnrfuse.FuseException: Mount point should be directory
	at ru.serce.jnrfuse.AbstractFuseFS.mount(AbstractFuseFS.java:263)
	... 15 common frames omitted

There is already an exception for winfsp:

if (!Platform.IS_WINDOWS) {
// winfsp requires non-existing directory to be provided
if (!Files.isDirectory(mountPoint)) {
throw new FuseException("Mount point should be directory");
}
}

There are, however, further cases in which it is desirable to mount to a non-existing directory. According to this commit to sshfs FUSE has certain workarounds:

In order to allow non-privileged users to mount FUSE volumes under /Volumes FUSE will create
non-existent mount points automatically.

Therefore I kindly request to either disable this check completely (let the software depending on jnr-fuse take care of it) or add an overloaded method, e.g. public void mount(Path mountPoint, boolean blocking, boolean debug, boolean requireMountPointToExist, String[] fuseOpts).

Thank you ❤️

@SerCeMan
Copy link
Owner

Hey, @overheadhunter!

Thank you for your patience. Looking at osxfuse, removing the check seems reasonable to me. That way, jnr-fuse will more closely resemble fuse.

Would you be able to open a PR? If not, I'll try to take a look at this sometime during the next week.

overheadhunter added a commit to overheadhunter/jnr-fuse that referenced this issue Feb 18, 2019
Partial undo of 6cbdc4d: Don't exist whether a mount point is an existing directory. This has already been removed for Windows in 4b97249. Rationale is discussed in issue SerCeMan#73.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants