Re: NSTask and 10.9 [SOLVED]

2013-11-27 Thread koko
NSString *scriptPath = [[NSBundle mainBundle] pathForResource:@DeleteHidden ofType:nil]; NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath:scriptPath]; The script DeleteHidden had line endings of cf,lf which caused an exception on 10.9 removing the cr via a hex editor resolved

Re: NSTask and 10.9 [SOLVED]

2013-11-27 Thread Kyle Sluder
On Nov 27, 2013, at 7:59 AM, koko k...@highrolls.net wrote: NSString *scriptPath = [[NSBundle mainBundle] pathForResource:@DeleteHidden ofType:nil]; NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath:scriptPath]; The script DeleteHidden had line endings of cf,lf which

NSTask and 10.9

2013-11-26 Thread koko
I need to remove hidden files from removable media and have been doing so successfully until 10.9. I use NSTask as follows: NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath:rootScriptPath]; [task setArguments:[NSArray arrayWithObjects:rootpath, nil]]; [task waitUntilExit

Re: NSTask and 10.9

2013-11-26 Thread Kyle Sluder
On Tue, Nov 26, 2013, at 07:47 AM, koko wrote: This works just fine up to and including 10.8.5 BUT throws an exception at [task launch] on 10.9 What is the exception? --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: NSTask and 10.9

2013-11-26 Thread Pax
paths you need to useā€¦ I hope that this helps. On 26 Nov 2013, at 15:47, koko k...@highrolls.net wrote: I need to remove hidden files from removable media and have been doing so successfully until 10.9. I use NSTask as follows: NSTask *task; task = [[NSTask alloc] init]; [task

Re: NSTask and 10.9

2013-11-26 Thread koko
On Nov 26, 2013, at 8:56 AM, Pax 45rpmli...@googlemail.com wrote: hy would you delete files in this manner? Need to wildcard the file names. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: NSTask and 10.9

2013-11-26 Thread Scott Ribe
On Nov 26, 2013, at 9:42 AM, koko k...@highrolls.net wrote: On Nov 26, 2013, at 8:56 AM, Pax 45rpmli...@googlemail.com wrote: hy would you delete files in this manner? Need to wildcard the file names. Get the directory contents and look for matches, or use glob. -- Scott Ribe

Re: NSTask and 10.9

2013-11-26 Thread Pax
So: NSFileManager *fileMgr = [NSFileManager defaultManager]; NSArray *contents = [fileMgr contentsOfDirectoryAtPath:path error:nil]; for (NSString *item in contents) { if ([item rangeOfString:wildcard].location !=NSNotFound) {

Re: NSTask and 10.9

2013-11-26 Thread Kyle Sluder
On Tue, Nov 26, 2013, at 09:37 AM, koko wrote: On Nov 26, 2013, at 10:26 AM, Kyle Sluder k...@ksluder.com wrote: Error 2 is ENOENT. The path you passed to -setLaunchPath: does not exist. Not possible as [task setLaunchPath:rootScriptPath]; where rootScriptPath is NSString

Re: NSTask and 10.9

2013-11-26 Thread Ken Thomases
On Nov 26, 2013, at 9:47 AM, koko wrote: NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath:rootScriptPath]; [task setArguments:[NSArray arrayWithObjects:rootpath, nil]]; [task waitUntilExit]; [task launch]; [task release]; You have the invocation of -launch and