Matt Jenns
2006-Nov-10 10:30 UTC
rsync 2.6.9 on OS X. files with xattrs don't retain mtime.
I'm really excited about the recent work on extended attributes. I've compiled 2.6.9 with xattr support, and run a few tests. It seems that if I have a file with an extended attribute ( a resource fork in this case), and I run rsync -aX , the mtime is not preserved. Example: stat xattrsrc/a 234881026 2894399 -rw------- 1 admin staff 0 1048576 "Nov 10 10:03:01 2006" "Nov 10 10:01:45 2006" "Nov 10 10:01:45 2006" 4096 2056 0 xattrsrc/a ./rsync -ax xattrsrc/a xattrdest/ stat xattrdest/a 234881026 2894405 -rw------- 1 admin staff 0 1048576 "Nov 10 10:03:01 2006" "Nov 10 10:01:45 2006" "Nov 10 10:03:01 2006" 4096 2048 0 xattrdest/a note the preserved mtime, but stripped resource fork. Now with -X: ./rsync -axX xattrsrc/a xattrdest/ stat xattrdest/a 234881026 2894405 -rw------- 1 admin staff 0 1048576 "Nov 10 10:03:01 2006" "Nov 10 10:12:23 2006" "Nov 10 10:12:23 2006" 4096 2056 0 xattrdest/a Is this the expected behaviour? matt
Wesley W. Terpstra
2006-Nov-10 14:57 UTC
rsync 2.6.9 on OS X. files with xattrs don't retain mtime.
On Nov 10, 2006, at 11:30 AM, Matt Jenns wrote:> I'm really excited about the recent work on extended attributes. I've > compiled 2.6.9 with xattr support, and run a few tests. It seems that > if I have a file with an extended attribute ( a resource fork in this > case), and I run rsync -aX , the mtime is not preserved. > > Is this the expected behaviour?No. However, it works for me:> ottawa:~/rsync/cvs terpstra$ ./rsync -ax peanut peanut2 > ottawa:~/rsync/cvs terpstra$ ./rsync -axX peanut peanut3 > ottawa:~/rsync/cvs terpstra$ stat peanut* > 234881035 3247760 -rw-r--r-- 1 terpstra terpstra 0 0 "Nov 10 > 15:33:02 2006" "Nov 10 15:33:02 2006" "Nov 10 15:33:12 2006" 4096 0 > 0 peanut > 234881035 3247791 -rw-r--r-- 1 terpstra terpstra 0 0 "Nov 10 > 15:46:40 2006" "Nov 10 15:33:02 2006" "Nov 10 15:46:40 2006" 4096 0 > 0 peanut2 > 234881035 3247792 -rw-r--r-- 1 terpstra terpstra 0 0 "Nov 10 > 15:46:45 2006" "Nov 10 15:33:02 2006" "Nov 10 15:46:45 2006" 4096 0 > 0 peanut3 > ottawa:~/rsync/cvs terpstra$ xattr --list peanut* > peanut > foo bar > peanut2 > peanut3 > foo barWhat filesystem are you using? I've tried HFS+ and UFS and both seemed to work. Looking over the code, it does write extended attributes after setting the mtime, but I wouldn't have thought this would matter. Indeed, on my computer, it doesn't.