Code Monkey home page Code Monkey logo

Comments (11)

SerCeMan avatar SerCeMan commented on May 24, 2024

Hi, @czeidler!

Is it Ubuntu x64 or x32? Did you make any change to HelloFuse?

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 24, 2024

Can you also post the debug output here?

from jnr-fuse.

czeidler avatar czeidler commented on May 24, 2024

Its ubuntu 17.04 x64. I started with my own implementation using only getattr and readdir but then copied HelloFuse over. So 98% sure that it unmodified. Here is some output. (Or is there some other debug output?) thanks!

LOOKUP /autorun.inf
getattr /autorun.inf
   unique: 8, error: -2 (No such file or directory), outsize: 16
unique: 9, opcode: READDIR (28), nodeid: 1, insize: 80, pid: 9351
readdir[0] from 0
   unique: 9, success, outsize: 16
unique: 10, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 10, success, outsize: 16
unique: 11, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 9351
   unique: 11, success, outsize: 32
unique: 12, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 9351
getattr /
   unique: 12, success, outsize: 120
unique: 13, opcode: READDIR (28), nodeid: 1, insize: 80, pid: 9351
readdir[0] from 0
   unique: 13, success, outsize: 16
unique: 14, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 14, success, outsize: 16

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 24, 2024

I started with my own implementation using only getattr and readdir but then copied HelloFuse over

So, is it just a HelloFuse.java without modifications? If so, is it working correctly when you try to invoke let's say ls?

from jnr-fuse.

czeidler avatar czeidler commented on May 24, 2024

I put breakpoints in all methods of HelloFuse but only getattr gets called. A ls only triggers a getattr but not a readdir... Maybe something with the bindings/ method signature is different under Ubuntu?

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 24, 2024

But is it working for you? Is it showing a file called hello?

from jnr-fuse.

czeidler avatar czeidler commented on May 24, 2024

no its showing nothing (because readdir is never called), I also tested it in the test case:
String[] content = tmpDir.toFile().list();
Nothing in content...

from jnr-fuse.

czeidler avatar czeidler commented on May 24, 2024

Initially I used javafs (but it does not seems to be under active development any more and I had some other issues) I got my fs working for javafs, so I just checked the callback signature in javafs:
int _readdir(String path, Pointer buf, Pointer fillFunction, @off_t long offset, @In Pointer info);

compared to your implementation there is an additional @in, is that important?
int readdir(String path, Pointer buf, Pointer filter, @off_t long offset, Pointer fi);

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 24, 2024

No, it isn't, @in and @out are mostly for optimization purposes.

Can you try to run ru.serce.jnrfuse.struct.HelloFuseTest?

from jnr-fuse.

czeidler avatar czeidler commented on May 24, 2024

Ok found the issues. The problem was simply that I still had the javafs code around and I guess this interfered with jnr-fuse... sorry for the noise.

Just an idea: Sometimes it happens that filesystems don't get umounted (e.g. when killing the jvm) Does it makes sense to add a method to force an umount?

static public void umount(Path mountPoint) {
        try {
            String mountPath = mountPoint.toAbsolutePath().toString();
            try {
                new ProcessBuilder("fusermount", "-u", "-z", mountPath).start();
            } catch (IOException e) {
                new ProcessBuilder("umount", mountPath).start();
            }
        } catch (IOException e) {
            throw new FuseException("Unable to umount FS", e);
        }
    }

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 24, 2024

@czeidler Yes, it might be a good idea to have unmount method in some special utils class.

You can open a PR if you find it convenient :)

from jnr-fuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.