[Mac] file copy

Jerry Hill malaclypse2 at gmail.com
Tue Jun 23 14:45:21 EDT 2009


On Tue, Jun 23, 2009 at 2:28 PM, Michael Torrie<torriem at gmail.com> wrote:
> mv, cp, etc (but not rsync) are completely aware of resource forks from
> Tiger on.  This is well documented and known on the Mac forums.
>
> So shutils should work just fine for copying, moving, etc.

I don't think that's true.  The shutil docs
(http://docs.python.org/library/shutil.html) has a big red box at the
top that says:

"""
Warning

Even the higher-level file copying functions (copy(), copy2()) can’t
copy all file metadata.

On POSIX platforms, this means that file owner and group are lost as
well as ACLs. On Mac OS, the resource fork and other metadata are not
used. This means that resources will be lost and file type and creator
codes will not be correct. On Windows, file owners, ACLs and alternate
data streams are not copied.
"""

If I understand the OP's question from the first email in this thread,
that should pretty strongly warn you that shutil.copy2 is not going to
do what you want.  Not being a mac user myself, I don't know what the
right way to accomplish what you want is, though.

-- 
Jerry



More information about the Python-list mailing list