PATCH: preserve osx creation-date (was: Using pre2 for backing up a mac)

Wesley W. Terpstra wesley at
Sun Oct 14 18:14:57 GMT 2007

On Oct 13, 2007, at 4:07 PM, Wesley W. Terpstra wrote:
> rsync 3pre2 now handles all but three items:
> 1. bsd flags
> 2. "locked flag" (supposedly finder meta-data)
> 3. creation date
> The creation date is AFAIK a mac os specific piece of meta-data and  
> can be accessed via the set/getattrlist + ATTR_CMN_CRTIME system  
> call on a mac. Again, this meta-data might be reasonably converted  
> into an extended attribute.

I've attached a patch which does this. Currently resource forks and  
finder info get placed into an extended attribute transparently by  
osx ({ResourceFork/FinderInfo}). This patch makes another  
"extended attribute" called The only issue  
I've found so far is that it gives warning when copying a symlink to  
linux as one can't set extended attributes there. It even works when  
copying from hfs to fat32 on the same mac. I don't understand where  
osx saves the creation date in a fat filesystem, but somehow it works!?

I admit it's a bit hack-ish to put this in the extended attribute get/ 
set methods, but this mimics the behaviour of the other osx-specific  
meta-data. Also, it seems reasonable to me that it should be copied  
when '-X' is specified. There is no fgetattrlist method, but it seems  
that sys_fgetxattr is actually never used b/c x_fstat is not used.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: creation-date.patch
Type: application/octet-stream
Size: 4153 bytes
Desc: not available
Url :

More information about the rsync mailing list