Cannot save from TextEdit or Preview on OSX
daniel-centore opened this issue · comments
Whenever I try to edit files on the MemoryFS using TextEdit or Preview, I get this error when I try to save:
"The document “Sample file.txt” could not be saved."
And this one when I try to close the file:
"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?
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.
any update in here @daniel-centore
@onrcandan no, I never figured this out. If anyone does figure it out, I would probably revive an old side project of mine...
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
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 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.
这个很简单就可以解决,只需要改一下statfs方法,让macos系统认为磁盘有空间即可正常保存