Re: file copying revisited
Re: file copying revisited
- Subject: Re: file copying revisited
- From: Ali Ozer <email@hidden>
- Date: Tue, 3 Jul 2001 09:03:42 -0700
>
first off, i'm a newcomer to the list, so if this topic has been beaten
>
to death, don't mind me. i've read through the web archives looking for
>
information on copying files with resource forks (or at least preserve
>
the type/creator codes). my original code used NSFileManager's
>
copyPath, which stripped the resource fork. then i saw someone mention
>
that using NSWorkspace's performFileOperation might do the trick.
>
unfortunately, this approach strips the resource fork as well. is there
>
any way to accomplish this in cocoa? i'd hate to have to introduce
>
MoreFiles into such an elegant environment :) TIA,
There are bunch of questions on this; just to clarify: NSFileManager
currently does not correctly copy or move resource forks and other
metadata. It might work in some cases (when you move files within a
volume for instance; or when you copy directories on NFS/UFS, where
metadata sits in extra files) but not in general, so don't count on it
in the general case. We are looking at this issue.
In the meantime, if you do need this, maybe someone out there has
written the code to do it? You can either use Carbon, or use lower level
functions which take care of dealing with attributes. Depending on your
needs you hopefully don't need a full rewrite of NSFileManager!
Ali