fcopyfile failed

30 views
Skip to first unread message

Adam Billyard

unread,
May 9, 2026, 8:49:43 AM (8 days ago) May 9
to macFUSE
I'm implementing Fuse for Uniflex so I can read disk images.

ls works  (mostly),  but when I use cp to copy a file, some files fail with:

fcopyfile failed:


1. If I add fprintf(stderr messages to my driver, where do they get stored?
2. How can I crank up the logging of FUSE?



Cristian Marius

unread,
May 9, 2026, 9:41:12 AM (8 days ago) May 9
to macFUSE
Hi Adam,

The fcopyfile failure has to do with extended attributes (I say this with around 90% confidence).

Try to retrurn in getxattr ENODATA or ENOATTR and see if it works.

For the quarantine com.apple.quarantine you can return ENODATA such that it wont  be treated as quarantined.

For logging by default it goes to syslog, try to run this: log stream --predicate 'sender == "macfuse"' to see the logs

I wrote about FUSE edge cases on macOS here: https://keibisoft.com/blog/keibidrop-fuse-deadlocks.html

All the best,
Marius-Florin Cristian
https://keibidrop.com

Adam Billyard

unread,
May 9, 2026, 11:48:24 AM (7 days ago) May 9
to osxfus...@googlegroups.com
Thanks.
Seeing the macfuse log is useful - thanks.  How do I insert my log messages into it?


This is a (UniFlex) file system from 1982, so has no extended attributes.   HAVE_SETXATTR is not defined.

the code to walk the Uniflex file descriptor table for direct, double indirect and triple indirect looks good.  

On this file system: 
 direct is < 10 blocks 
 single indirect < 10 + 128 blocks
double indirect < 10 + 128 + 128*128 blocks

Yet a 10k file copies to the host file system without issue,  it appears a file of >16k causes cp to fail.   
The 10K file is > 5120 bytes so will be using single indirection, yet a slightly larger file fails..



--
You received this message because you are subscribed to the Google Groups "macFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/osxfuse-group/1339adc4-08f6-4add-be78-f47736e24ec1n%40googlegroups.com.

Cristian Marius

unread,
May 9, 2026, 1:00:41 PM (7 days ago) May 9
to macFUSE
Hi again,

Hard to answer, as I have only used macFUSE from cgofuse.

But this is how I used my custom logger: https://github.com/KeibiSoft/KeibiDrop/blob/a22f86a02920ff13c78acbfd0d26cdc313ba1093/pkg/filesystem/fuse_directory.go#L258
you can redirect your logger to w/e you want stdin, stdout, a net conenction.

On the highlevel call that I intercept, and add my custom logic.


Now about your block logic, I think you do not support reads that are past the offset. I think either you need to consider it sparse and return zeroes, or the appropriate syscall error message (like EOF)

You need to check your read handle to see the number of bytes you return.


All the best,
Marius-Florin Cristian
https://keibidrop.com


Adam Billyard

unread,
May 10, 2026, 6:32:41 AM (7 days ago) May 10
to osxfus...@googlegroups.com
Good catch. I owe you a beer. You put me on the right path - all working great now.  Github repo here:  https://github.com/Elektraglide/Fuse4UNIFLEX 

It was a corner of handling long filenames;  UniFlex just appends multiple DIR slots to make longer filenames and the termination logic was subtly wrong.

And the fs_readfile() had an early-out like this:

if (readsize >= filesize)

{

  return readsize;

}


But readsize is relative to the offset, not the whole file.. Doh.




Reply all
Reply to author
Forward
0 new messages