Re: NSTask and 10.9 [SOLVED]
Re: NSTask and 10.9 [SOLVED]
- Subject: Re: NSTask and 10.9 [SOLVED]
- From: Kyle Sluder <email@hidden>
- Date: Wed, 27 Nov 2013 08:34:00 -0800
> On Nov 27, 2013, at 7:59 AM, koko <email@hidden> 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 caused an exception on 10.9
> removing the <cr> via a hex editor resolved the 10.9 issue
Ha! Indeed, I can reproduce this on my machine using Terminal.app:
% cat foo
#!/bin/sh
echo Hello, world
% ./foo
zsh: ./foo: bad interpreter: /bin/sh^M: no such file or directory
So technically posix_spawn wasn't lying—when it parsed your shebang
line, it saw `#!/bin/sh<CR>`, and couldn’t find a shell named `sh<CR>`
to launch it.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden