Re: Can't copy files...
Re: Can't copy files...
- Subject: Re: Can't copy files...
- From: Chris Parker <email@hidden>
- Date: Thu, 13 Dec 2001 10:10:35 -0800
Riccardo,
It looks like the result of your copyPath:toPath:handler: call is
returning "NO" - if I had to make a bet it's because
/Users/riccardo/Desktop/dirb already exists.
The copyPath:toPath:handler: method doesn't work with the 'cp' semantics
off the command line - you -must- supply a target filename that doesn't
exist at the time of the call.
Where 'fm' is an instance of the default NSFileManager:
[fm copyPath:@"/Users/riccardo/Desktop/dira/poof.sit"
toPath:@"/Users/riccardo/Desktop/dirb/poof.sit" handler:nil];
/Users/riccardo/Desktop/dirb should exist, but
/Users/riccardo/Desktop/dirb/poof.sit must not exist.
The handler is an object that you can define to accept certain messages
from NSFileManager when it begins an operation, or to check for more
detailed information about the error that occurred - the methods your
handler object would take are shown in the NSFileManager document under
the "Methods Implemented By The Delegate" section.
If your handler object were to implement the
fileManager:shouldProceedAfterError: message, you'd get a dictionary you
could examine for the error code.
Passing 'nil' for the handler object just means you are specifying that
no object will receive these messages.
.chris
On Thursday, December 13, 2001, at 04:28 AM, Riccardo Santato wrote:
Hi everybody,
after having implemented Ondra's suggestion for copying files, here it
is
what PB return me out:
XFiles[407] Copying (/Users/riccardo/Desktop/dira/poof.sit) to (/Users/
riccardo/Desktop/dirb) using <NSFileManager: 0x879c0>
XFiles[407] Result 0
XFiles.app has exited with status 0
Well, i'ts quite obvious that the name for the app is "XFiles"
(temporary
name). Less obvious is the fact that the selector doesn't return me any
error and the app DOESN'T quit by itself. I start supposing the problem
is the "handler" argument in the selector (I gave "nil") . I don't
fully
understand why should I give a nil pointer for a file operation...
What's going on ?
--
Riccardo Santato
www.riccardosantato.com
_______________________________________________
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.