Quantcast

fuse - Setting target of Symbolic link - Java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

fuse - Setting target of Symbolic link - Java

Syed Rahman
I want to make symbolic link in FUSE (Fuse-jna, Java binding of fuse). I implemented readdir() and getattr() correctly but I do not correctly know that how to implement the readlink().

Here is my getattr() method

public int getattr(final String path, final StatWrapper stat)
{
    ...
    stat.setMode(NodeType.SYMBOLIC_LINK);
    return 0;
}

I want to set target of my symbolic link as /Documents/Untitled Document

I tried below, but it is not working.

 public int readlink(final String path, final ByteBuffer buffer, final long size)
{

    CharBuffer cbuf = buffer.asCharBuffer();
    cbuf.put("/Documents/Untitled Document");
    cbuf.flip();

    return 0;
}


Please guide me how to correctly set the target of symbolic link

Thanks
Loading...