jnr-fuse icon indicating copy to clipboard operation
jnr-fuse copied to clipboard

Cannot save from TextEdit or Preview on OSX

Open daniel-centore opened this issue 4 years ago • 7 comments

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?

daniel-centore avatar Feb 06 '20 07:02 daniel-centore

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.

SerCeMan avatar Feb 06 '20 12:02 SerCeMan

any update in here @daniel-centore

onrcandan avatar Oct 25 '22 08:10 onrcandan

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

daniel-centore avatar Oct 25 '22 19:10 daniel-centore

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

stanimirivanovde avatar Oct 25 '22 20:10 stanimirivanovde

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

daniel-centore avatar Oct 26 '22 00:10 daniel-centore

@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.

stanimirivanovde avatar Nov 03 '22 20:11 stanimirivanovde

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

fs185085781 avatar Dec 16 '23 06:12 fs185085781