SerCeMan / jnr-fuse

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

Cannot save from TextEdit or Preview on OSX #93

Open daniel-centore opened 4 years ago

daniel-centore commented 4 years ago

Whenever I try to edit files on the MemoryFS using TextEdit or Preview, I get this error when I try to save:

image "The document “Sample file.txt” could not be saved."

And this one when I try to close the file: image

"The document “Sample file.txt” is on a volume that does not support permanent version storage."

The console log suggests that it's trying to access files with weird suffixes like ".sb-c840fa8f-BaE37t".

Any idea how to resolve this so the MemoryFS can behave like a normal APFS volume?

SerCeMan commented 4 years ago

Hey, @daniel-centore! MemoryFS is a simple toy example of how you could build a full-fledged file system backed by fuse. For open-source examples of file systems built on fuse, you can refer to projects-using-jnr-fuse or any other projects that use fuse since they're pretty much interchangeable.

onrcandan commented 1 year ago

any update in here @daniel-centore

daniel-centore commented 1 year ago

@onrcandan no, I never figured this out. If anyone does figure it out, I would probably revive an old side project of mine...

stanimirivanovde commented 1 year ago

This is due to the extended attribute support for Mac OS X. You either have to implement the full xattr FUSE functions or disable the xattr support with: -oauto_xattr

daniel-centore commented 1 year ago

You either have to implement the full xattr FUSE functions or disable the xattr support with: -oauto_xattr

I had tried to do this but for some reason still couldn't get it to work. Having a simple, working example of how to do this in MemoryFS would definitely be helpful

stanimirivanovde commented 1 year ago

@daniel-centore this is outside the simple example and the project's idea. It really goes down to what are the actual OS kernel requirements to properly implement a user-space file system. Another option you can give a try is -oauto-cache. This option was important to fix multiple bugs in our software.

The following options together worked fine for our propitiatory FS:

-ovolname=SimpleFS
-odaemon_timeout=30
-oauto_xattr
-odefault_permissions
-oallow_other
-oauto_cache

But this means your implementation of the APIs need to be correct as well.

fs185085781 commented 8 months ago

这个很简单就可以解决,只需要改一下statfs方法,让macos系统认为磁盘有空间即可正常保存