Re: Async File Copying?
Re: Async File Copying?
- Subject: Re: Async File Copying?
- From: Fawzi Mohamed <email@hidden>
- Date: Thu, 17 May 2001 09:24:08 +0200
try to spawn a thread that makes the copy:
[NSThread detachNewThreadSelector:@selector(doTheCopy:)
toTarget:myCopyObject
withObject:myObjectWithInputParams];
then in the method
- (void)doTheCopy:(NSDictionary *)params;
you would call
[[NSWorkspace sharedWorkspace]
performFileOperation:NSWorkspaceCopyOperation ....]
I forgot to say that you should set up an autorelease pool in it to
avoid leaks:
- (void)doTheCopy:(NSDictionary *)params
{
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
[[NSWorkspace sharedWorkspace]
performFileOperation:NSWorkspaceCopyOperation ....];
[pool release];
}
fawzi
On Thursday, May 17, 2001, at 07:27 AM, Steve Gehrman wrote:
I've tried both:
[[NSWorkspace sharedWorkspace]
performFileOperation:NSWorkspaceCopyOperation ....]
and
[[NSFileManager defaultManager] copyPath ... ]
and both of them copy files synchronously (spinning rainbow until copy
is done). Is there any easy way to do a asynchronous file copy
besides writing it all from scratch?
steve
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev