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

Developer discussions.

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

Postby madison437 » Sun May 26, 2019 11:30 am

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
Attachments
xattred Screenshot comparison.png
xattred Screenshot comparison.png (86.26 KiB) Viewed 29365 times
madison437
 
Posts: 7
Joined: Wed Jul 29, 2015 2:06 pm

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

Postby lundman » Sun May 26, 2019 3:48 pm

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.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

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

Postby madison437 » Mon May 27, 2019 11:28 am

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
madison437
 
Posts: 7
Joined: Wed Jul 29, 2015 2:06 pm

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

Postby lundman » Mon May 27, 2019 5:13 pm

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.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

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

Postby madison437 » Sat Jun 01, 2019 10:22 am

Thanks.
madison437
 
Posts: 7
Joined: Wed Jul 29, 2015 2:06 pm


Return to OpenZFS on OS X Development

Who is online

Users browsing this forum: No registered users and 12 guests