I'm confused. Earlier you wrote
the resource fork should only exist on compressed files, and cp DOES copy those
but in your last reply
Use the Finder to do the copy, not cp
and
cp decompressed the file, which ended up stripping the xattrs
This doesn't make sense to me...
I tried creating a file with a resource fork as you suggested, but again I wasn't able to reproduce the "Result too large" issue. The file, an empty .txt file on my Mac (macOS 26.2) which I added a 14.1 MB resource fork to, now displays as 14’136’946 bytes (14.1 MB on disk) in the Finder. Copying it to the FAT volume (inserted in my router and connected via SMB to my Mac) with the Finder, the cp command, or the test app I showed at the beginning which uses copyfile: they all worked, and the Finder displays the destination file as 14.1 MB.
The only error I got was when trying to add the resource fork to an empty file created on the SMB volume:
cat: stdout: Operation not permitted
So I copied the file with the resource fork on my Mac to the SMB volume in the Finder, then copied the file on the SMB volume back to my Mac with each of the 3 methods above, and they all produced the same result: a Zero bytes file without a resource fork (confirmed by ls -l@). I don't know why this is the case.
I'm wondering: does this mean
The test above was done with both machines running macOS 26.3 and the underlying source volume being APFS
that I can only reproduce it when at the other end of the SMB connection there is a Mac, or if the volume at the other end is formatted APFS?
Note: I repeatedly used the ls -l@ command to check whether the various file copies had a resource fork. Randomly, I got weird results. The correct one would be:
com.apple.ResourceFork 14136946
com.apple.quarantine 23
but sometimes I got a smaller resource fork
com.apple.ResourceFork 11534336
com.apple.quarantine 23
or
com.apple.ResourceFork -1
com.apple.quarantine 23
or even
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
Please forgive me if I say that these resource forks are already giving me headaches...
Topic:
App & System Services
SubTopic:
Core OS
Tags: