SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)
MIT License
365 stars 87 forks source link

Possible fix for issue #37 #41

Closed APayerl closed 6 years ago

APayerl commented 6 years ago

possible fix for #37 Either it works or it doesn't change anything.

APayerl commented 6 years ago

@SerCeMan I'm have to be an idiot but I really don't get these errors and how to solve them... I'm guessing your able to see the code I tried to submit so you might be able to grab it?

SerCeMan commented 6 years ago

No worries, I think that the problem is that it uses jnr.ffi.Runtime instead of java.lang.Runtime

SerCeMan commented 6 years ago

So, it can be fixed by changing Runtime.getRuntime().exec to java.lang.Runtime.getRuntime().exec

APayerl commented 6 years ago

oh okay....Should I try a third time or will you do it if you consider the code acceptable?

APayerl commented 6 years ago

@SerCeMan did the edit but then test test failed instead.. -_- al least it wasn't the code I wrote this time even though it might have caused it...

SerCeMan commented 6 years ago

The exception that you're seeing is

java.lang.IllegalStateException: No match found

    at java.util.regex.Matcher.group(Matcher.java:536)
    at ru.serce.jnrfuse.AbstractFuseFS.getRegistryKey(AbstractFuseFS.java:124)
    at ru.serce.jnrfuse.AbstractFuseFS.<init>(AbstractFuseFS.java:74)
    at ru.serce.jnrfuse.FuseStubFS.<init>(FuseStubFS.java:23)
    at ru.serce.jnrfuse.examples.MemoryFS.<init>(MemoryFS.java:225)
    at ru.serce.jnrfuse.struct.MemoryFsTest.testReadWrite(MemoryFsTest.java:20)

One of the possible solutions is to replace the regex part with

            String[] keyParts = content.split(" {4}");
        if(keyParts.length > 3) {
            return keyParts[3] + "\\bin\\winfsp-x64.dll";
            }
SerCeMan commented 6 years ago

@APayerl Thanks for the contribution, I'll tag you in the upstream patch.

APayerl commented 6 years ago

Happy to help!