Re: Cocoa File Copy on MacOS X
Re: Cocoa File Copy on MacOS X
- Subject: Re: Cocoa File Copy on MacOS X
- From: Chris Parker <email@hidden>
- Date: Sat, 6 Apr 2002 11:43:32 -0800
Hi Lorenzo,
On Saturday, April 6, 2002, at 10:11 AM, Lorenzo Puleo wrote:
2)
[manager copyPath:sourceItem toPath:destItem handler:nil];
Both of them copy the file, but in some cases they produce bad result.
In
some cases no resource fork was been copied, the creation and
modification
dates of the destination file report the present date/time, in other
cases
If the source file is "read only" I can't later set the right attributes
(read: modification and creation date) of the destination file...
Also, I
can't see a way to set the creation date of the destination file equal
to
the source file one. Actually I use an old C++ routine. May be I have to
learn more about Cocoa. So please help me.
NSFileManager's movePath:toPath:handler: and copyPath:toPath:handler:
methods preserve resource forks, although they do not (at present)
preserve all HFS+ metadata (as I see you've noticed by reading through
my back mail).
The creation date problem you've addressed with your own code, which is
at present the only solution. This is being addressed in a future
release of the operating system.
Someone in this mailing list suggested to use MoreFiles routines...
(again?).
I can't believe Apple didn't yet grant a simple, easy, fast and secure
way
to copy a file (just as the Finder used to do) in ANY condition, to ANY
file
system, to ANY remote server, EVERYTHING, EVERYWHERE, ALWAYS, FOREVER.
Other than some of the metadata, the resource and data forks should be
copied, and the copy will be performed correctly across filesystems. If
you're having problems with the routines, I'd love to have code and file
examples that demonstrate this so I can try to pin the problem down.
.chris
--
Chris Parker <email@hidden>
Cocoa Frameworks Engineer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.