Search code examples
openoffice.orglibreofficefuse

Fuse File System- general input/output error while accessing office files


I have written a fuse mirror file system using FUSE-JNA, Which mirror local directory.

This Mirror file system allow me to open all types of files correctly with no issue but it does not open all types of office files e.g. .docs , .xls etc. And give me be below error while opening any office file.

http://i61.tinypic.com/2wd4j9c.png

Note: I thought its LibreOffice issue, so I removed it and installed OpenOffice. But get the same issue. Secondly, the errors only pops up when I try to access an office file from my MirrorFileSystem. Office files opens correctly if accessed normally via ubuntu default file system.

So its some thing wrong with my File system.

Finally, (i don't know whether its related to the question or not but) in my mirror file system when I Right Click on a file>Properties> Permission its shows all the fields disabled, as below

enter image description here

This is my getatt() method:

public int getattr(final String path, final StatWrapper stat)
{
....
if (f.isFile())
    {
        stat.setMode(NodeType.FILE,true,true,true,true,true,true,true,true,true);
        stat.size(f.length());
        stat.atime(f.lastModified()/ 1000L);
        stat.mtime(0);
        stat.nlink(1);
        stat.uid(0);
        stat.gid(0);
        stat.blocks((int) ((f.length() + 511L) / 512L));
        return 0;
    }
...
}

Please guide me how to fix general input/output error while office files?


Solution

  • Thanks for the answer.

    I searched on web, on many websites they showed file locking as the reason e.g. https://forum.openoffice.org/en/forum/viewtopic.php?f=10&t=2020 etc

    So in fuse, I implemented file lock function and simply return 0

    My problem solved. Now I can open all types of office files.

    But I do not know, is it perfect solution