Apart from the creation date discussion, I guess it hasn't been
absolutely clear yet what deficiencies in Apple's pertinent file
copying tools people like Dan have complained here, so for
completeness some facts, also to be found in my post [1]. Of course
all Apple tools don't preserve creation dates, which is still topic
of the discussion here...
- cp -Rp doesn't preserve symlink owners [2] (rdar://4523881)
- ditto doesn't preserve symlink owners (rdar://4523882), BSD flags,
locked flag, HFS+ extended attributes, ACLs (forgot to file a rdar
on these ones...)
ditto should (expectedly) mimic the Finder's copy functionality. As
such an argument could be made that since the geometry of the files
are different the ACL from one file shouldn't apply to the other.
- rsync -aE doesn't preserve BSD flags, locked flag, modification
date of files with resource forks, ACLs (I'm sure there's gazillions
of rdars)
It also doesn't appear to be able to copy files with both ACLs and
resource forks. It appears to only work if you have one or the other.
At least that was the last time I checked.
- asr (file-level) doesn't preserve symlink owners (rdar://4523924);
in 10.4.6 there's a regression by which it doesn't preserve BSD
flags, locked flag, HFS+ extended attributes, ACLs, either
(rdar://4523878).
I haven't done any investigation of archive formats such as tar, so
I can't tell how Apple's tools fare in that respect.
I have.
Findings:
=========
- ACLs stored and restored but modified in structure
- Extended Attributes generate error on creation of tarball, aren't restored
- symlink ownership changes
- creation dates maintained
Evidence:
=========
# generate some files with various properties
ooblek:~/xyzzy dshoop$ touch file
ooblek:~/xyzzy dshoop$ touch fileacl
ooblek:~/xyzzy dshoop$ chmod +a "admin allow read" fileacl
ooblek:~/xyzzy dshoop$ touch filebsdflags
ooblek:~/xyzzy dshoop$ sudo chflags arch filebsdflags
Password:
ooblek:~/xyzzy dshoop$ touch filexattr
ooblek:~/xyzzy dshoop$ xattr --set color blue filexattr
ooblek:~/xyzzy dshoop$ sudo ln -s file filesymlink
ooblek:~/xyzzy dshoop$ ls -alseo
total 8
0 drwxr-xr-x 7 dshoop dshoop - 238 Jun 27 14:59 .
0 drwxrwx--- 170 dshoop dshoop - 5780 Jun 27 14:56 ..
0 -rw-r--r-- 1 dshoop dshoop - 0 Jun 27 14:57 file
0 -rw-r--r-- + 1 dshoop dshoop - 0 Jun 27 14:57 fileacl
0: group:admin allow read
0 -rw-r--r-- 1 dshoop dshoop arch 0 Jun 27 14:57 filebsdflags
8 lrwxr-xr-x 1 root dshoop - 4 Jun 27 14:59 filesymlink -> file
0 -rw-r--r-- 1 dshoop dshoop - 0 Jun 27 14:58 filexattr
ooblek:~/xyzzy dshoop$ xattr --list *
file
fileacl
filebsdflags
filesymlink
filexattr
color blue
# create tarball of files
# note error generated on file with xattr!
ooblek:~/xyzzy dshoop$ /usr/bin/tar -cvf ../xyzzy.tar ./
./
./file
./._fileacl
./fileacl
./filebsdflags
./filesymlink
/usr/bin/tar: /tmp/tar.md.foSgCs: Cannot stat: No such file or directory
./filexattr
/usr/bin/tar: Error exit delayed from previous errors
# list tarball
# note Apple Double created only for file with ACL!
ooblek:~/xyzzy2 dshoop$ cd ../
ooblek:~ dshoop$ /usr/bin/tar -tvf xyzzy.tar
drwxr-xr-x dshoop/dshoop 0 2006-06-27 14:59:01 ./
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:15 ./file
-r-------- dshoop/wheel 223 2006-06-27 14:57:18 ./._fileacl
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:18 ./fileacl
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:44 ./filebsdflags
lrwxr-xr-x root/dshoop 0 2006-06-27 14:59:01 ./filesymlink -> file
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:58:24 ./filexattr
iWiring provides systems and networks support for Mac OS X, unix, and
Open Source application technologies at affordable rates.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden