SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"New File" under windows not showing

Jazzpirate opened this issue · comments

Not sure if this is an issue with jnr-fuse, winFSP or my Fuse implementation, but:

Mounting a drive under windows, the "New->(File type)" option in the context menu of windows explorer does not show up. "New Directory" does though. It also doesn't show with the example implementations listed in the readme, which makes me think the problem is probably not my implementation. Any idea how to make it show up? Are there certain permissions that need to be set or something? The drive seems to be writable in general - in the memory-file-example-implementation, I can e.g. just save a new text file to the drive, I just can't create a new one via the context menu...

commented

Hi, I see that this issue was created 4 years ago, but maybe it will be useful to someone else, I ran into this problem and I solved it.

The problem occurs due to the permissions system in Windows, the access mask that we set in st_mode inside the getattr method is applied to a non-existent or technical user, as a result of which the explorer believes that we do not have write rights

image

To solve that problem set st_uid and st_gid to 65792, that means "Everyone" group.

stat.st_mode.set(FileStat.S_IFDIR | 0777);
stat.st_uid.set(65792);
stat.st_gid.set(65792);

And that works

image
image

Read more here: winfsp/winfsp#40 (comment)