Colas,

Do you want your app to open a Terminal window, in which Pico has opened the 
file at /Users/colas/myfile.txt?
If that’s so, I don’t think launching it via NSTask is going to get you 
anything.

What is the end result you want to achieve?
—
Bryan Vines

On Apr 14, 2014, at 8:59 AM, Colas B <colasj...@yahoo.fr> wrote:

> Dear cocoa-dev,
> 
> 
> I am would like to launch a binary as if I launched it via terminal. I tried 
> the following but it is not working. 
> 
>    NSTask * myTask = [[NSTask alloc] init];
> 
>    NSArray * arguments = @[@"-c", @"-l", @"'/usr/bin/pico 
> /Users/colas/myfile.txt'"];
> 
>    [myTask setCurrentDirectoryPath:@"/"];
>    [myTask setLaunchPath:@"/bin/bash"];
>    [myTask setArguments:arguments];
> 
>    [myTask launch] ;
> 
> If I execute the same commands in a terminal, it works !!
> 
> $ /bin/bash -c -l '/usr/bin/pico /Users/colas/myfile.txt'
> 
> 
> Any remark will be appreciated !!
> Thanks,
> 
> Colas
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/bkvines%40me.com
> 
> This email sent to bkvi...@me.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to