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

Check compatibility #18

Closed
tobihagemann opened this issue Sep 6, 2018 · 2 comments
Closed

Check compatibility #18

tobihagemann opened this issue Sep 6, 2018 · 2 comments
Labels
Milestone

Comments

@tobihagemann
Copy link
Member

Minimum version of FUSE for macOS should be checked, see cryptomator/cryptomator#657.

@overheadhunter overheadhunter added this to the 1.0.0 milestone Sep 20, 2018
@overheadhunter
Copy link
Member

According to this issue the best way to get the "FUSE for macOS " version is by invoking const char *osxfuse_version(void) after loading libosxfuse.dylib.

Using JNR this could look like this:

public class FuseForMacVersionChecker {

	private static final String DYLIB_NAME = "osxfuse";

	public Optional<String> getVersion() {
		try {
			FuseDarwin lib = LibraryLoader.create(FuseDarwin.class).load(DYLIB_NAME);
			return Optional.of(lib.osxfuse_version());
		} catch (UnsatisfiedLinkError e) {
			return Optional.empty();
		}
	}

	// see /usr/local/include/osxfuse/fuse/fuse_darwin.h
	public interface FuseDarwin {
		String osxfuse_version();
	}
}

However, the library is already loaded via jnr-fuse, so maybe they can provide such a method...?

@infeo
Copy link
Member

infeo commented Oct 1, 2018

Another possibility is to parse the file /Library/Filesystms/osxfuse.fs/Contents/version.plist. In this file the version of the installed osxfuse bundle is listed.
The good thing about this way is that we don't need to load the library ourself.
The bad thing is that we need read access to this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants