Testing FILENAME/..namedfork/rsrc, it seems to work if one writes and reads via that special path, but if you write the extended attribute directly using xattr, you cannot read it via the special path:
- Code: Select all
touch testfile-rfork.txt
echo "HelloWorld" > testfile-rfork.txt/..namedfork/rsrc
ls -aleO@ testfile-rfork.txt
-rw-r--r--@ 1 user staff - 11 22 Feb 21:37 testfile-rfork.txt
com.apple.ResourceFork 11
xattr -lx testfile-rfork.txt
com.apple.ResourceFork:
00000000 48 65 6C 6C 6F 57 6F 72 6C 64 0A |HelloWorld.|
0000000b
cat testfile-rfork.txt/..namedfork/rsrc
HelloWorld
# so far, so good; but now let's write a new value via xattr:
xattr -w com.apple.ResourceFork "Hello You" testfile-rfork.txt
xattr -lx testfile-rfork.txt
com.apple.ResourceFork:
00000000 48 65 6C 6C 6F 20 59 6F 75 |Hello You|
00000009
cat testfile-rfork.txt/..namedfork/rsrc
cat: testfile-rfork.txt/..namedfork/rsrc: No such file or directory
To test ResourceForks on symlinks, you need the '-s' option for xattr so that it writes to the symlink itself, and not through to its target.
- Code: Select all
ln -s testfile-zfs testlink-zfs
# notice the -s option:
xattr -ws com.apple.ResourceFork "Whatever" testlink-zfs
ls -l@ testlink-zfs
lrwxr-xr-x@ 1 user staff 13 22 Feb 18:52 testlink-zfs -> testfile-zfs
com.apple.ResourceFork 8
About the ARCHIVE flag: I am not using it myself at all (as far as I am aware, you never know what some applicatrions try to do).
It just failed in my test cases that simply tried out all BSD flags on file, dir and symlinks.
But I agree, this is not the most urgent thing to fix.
The ..namedFork path above appears to be more important because I cannot set a custom icon on a folder of file via Finder. I do not know why, but the icon is not correctly displayed when set on a folder, and it simply does not work when tried on a file.
I also tried to sync files with ResourceForks using rsync. Rsync seems to write them as extended attributes - and then I can't read the resource fork of the synced copy via the special path, while I could do so on the source file before the rsync.