Page 1 of 1

"com.apple.FinderInfo" xattr data copy to O3X not faithful?

PostPosted: Sun May 26, 2019 11:30 am
by madison437
The result of Finder copies, copies via commandline, or ChronoSync, the xattr "com.apple.FinderInfo" does not seem to be entirely faithful.

My understanding is that it's a binary fixed length of 32 bytes.
When I copy using the Finder, using the command line, or via ChronoSync the result is that there is extra "info" added to the 32 bytes.
For example:

the ORIGINAL SOURCE might be:
com.apple.FinderInfo (32 bytes):
<50545820 5054756c 00000000 00000000 00000000 00000000 00000000 00000000>

String content:
PTX PTul


And the RESULTANT COPY would be:
com.apple.FinderInfo (32 bytes):

<50545820 5054756c 00000000 00000000 00000000 5ceae387 00000000 00000000>
Binary data as string:
«PTX PTul\êㇻ


See the screenshot where I used the xattred application to compare two files, one on an original APFS volumes, the other on a O3X zfs volume.

Also, using "rsync -rlptDvnihxHEXN" to compare the directories, it also reveals a difference in the xattr consistent with this assessment.

Platform:
OS X 10.14.5 (Mojave)

Tested using release:
O3X 1.8.2

Also tested using Beta:
O3X 1.9.0 RC3

Same result with both.

Thanks!

-- madison

Re: "com.apple.FinderInfo" xattr data copy to O3X not faithf

PostPosted: Sun May 26, 2019 3:48 pm
by lundman
Yes, we update the ADDTIME field before returning it:

Code: Select all
      extinfo->date_added = OSSwapBigToHostInt32(va_crtime.tv_sec);


as was required by something. It could be it should only be updated under certain circumstances though, but never did come across an official documentation on it.

Re: "com.apple.FinderInfo" xattr data copy to O3X not faithf

PostPosted: Mon May 27, 2019 11:28 am
by madison437
Thanks for this reply.

Yes, copies from the same volume to an APFS volume via the various methods mentioned do not trigger this update, at least for the conditions I tried.

I'm not a developer, but maybe I can poke around to see if there's more information.

If you off-hand know of any pointers as to docs where to start looking, or open-source Apple code aside from what I might uncover in Google searches and the like -- feel free to share.

Again, thanks.

-- madison

Re: "com.apple.FinderInfo" xattr data copy to O3X not faithf

PostPosted: Mon May 27, 2019 5:13 pm
by lundman
I read the sources for HFS the most, to see what they do - the logic around ADDTIME wasn't entirely clear. I would consider that to be the definitive source, especially since apfs has no sources for us to peruse.

Re: "com.apple.FinderInfo" xattr data copy to O3X not faithf

PostPosted: Sat Jun 01, 2019 10:22 am
by madison437
Thanks.