• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask and 10.9 [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTask and 10.9 (From: koko <email@hidden>)
 >Re: NSTask and 10.9 (From: Kyle Sluder <email@hidden>)
 >Re: NSTask and 10.9 (From: Kyle Sluder <email@hidden>)
 >Re: NSTask and 10.9 [SOLVED] (From: koko <email@hidden>)

  • Prev by Date: Re: NSTask and 10.9 [SOLVED]
  • Next by Date: Re: iOS screen physical size (or px density)
  • Previous by thread: Re: NSTask and 10.9 [SOLVED]
  • Next by thread: Re: NSTask and 10.9
  • Index(es):
    • Date
    • Thread