Copying files
Copying files
- Subject: Copying files
- From: Lorenzo Puleo <email@hidden>
- Date: Sat, 23 Mar 2002 16:04:57 +0100
Hi,
I have to copy a file. I know two commands which do this. But both of these
commands use pathname strings for source and destination items.
If I had on my desktop two volumes with the same name, how should I copy my
file to the disk I want? C++ lets me retrive the proper disk using the
FSSpec record, but now?
Also, with C++ I also used AliasHandle to point to files placed to unmounted
disk and Alias Manager asked to the user to insert the required disk or
mounted the volume automatically. Does Cocoa grant similar commands?
The first command I could use to copy a file is:
[myWorkSpace performFileOperation:NSWorkspaceCopyOperation source:sourceDir
destination:destDir files:singleItem tag:&theTag];
The arguments "source" and "destination" are NSString.
The second command I could use to copy a file is:
[manager copyPath:sourceItem toPath:destItem handler:nil];
The arguments "copyPath" and "toPath" are NSString.
I hope there is a way to get such a File ID and such a Volume ID, hoping
this way works even on different file systems (like Unix, Windows, Linux).
Is anybody knowing the solution? Thanks in advance.
--
Last but not least, since the above commands don't copy the Creation Date of
the source file to the destination file, how should I set the Creation Date
of a file? I know how to set the Modification Date and other attributes:
sourceAttribute = [manager fileAttributesAtPath:sourceItem traverseLink:NO];
[manager changeFileAttributes:sourceAttribute atPath:destItem];
but I can't find a way to set the Creation Date. I know, I have to learn
more and more, anyway, I hope someone could help me. Thanks.
--
Lorenzo - email@hidden
_______________________________________________
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.