Re: NSTask not working for shell scripts?
Re: NSTask not working for shell scripts?
- Subject: Re: NSTask not working for shell scripts?
- From: Robert Staflin <email@hidden>
- Date: Tue, 3 Dec 2002 14:05:12 +0100
? I don't think I understand the first line in your answer - the shell
script should be run by the NSTask, and not the other way around...
Thanks for the advice about the console - beginner mistake. It gave me
info on the crash log which says:
Date/Time: 2002-12-03 13:49:29 +0100
OS Version: 10.2.2 (Build 6F21)
Host: Robert-Staflins-Computer.local.
Command: Moriarity
PID: 2013
Exception: EXC_BREAKPOINT (0x0006)
Code[0]: 0x00000001Code[1]: 0x9080a610
Thread 0 Crashed:
#0 0x9080a610 in -[NSConcreteTask launchWithDictionary:]
#1 0x000044f8 in -[TaskWrapper startProcess] (TaskWrapper.m:112)
#2 0x00003da8 in -[RoutRController sleuth:] (RoutRController.m:45)
#3 0x930cfe2c in -[NSApplication sendAction:to:from:]
#4 0x9315bff0 in -[NSControl sendAction:to:]
#5 0x93113a38 in -[NSCell _sendActionFrom:]
#6 0x93113fc4 in -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
#7 0x930fef78 in -[NSButtonCell
trackMouse:inRect:ofView:untilMouseUp:]
#8 0x9315c898 in -[NSControl mouseDown:]
#9 0x9336dfd4 in -[NSWindow sendEvent:]
#10 0x930ce328 in -[NSApplication sendEvent:]
#11 0x930ca524 in -[NSApplication run]
#12 0x930d2598 in NSApplicationMain
#13 0x00003c58 in main (main.m:5)
#14 0x000039dc in _start (crt.c:267)
#15 0x0000385c in start
Thread 1:
#0 0x90015248 in syscall_thread_switch
#1 0x907f4304 in +[NSThread sleepUntilDate:]
#2 0x93351900 in -[NSUIHeartBeat _heartBeatThread:]
#3 0x9081cd38 in forkThreadForFunction
#4 0x90021268 in _pthread_body
PPC Thread State:
srr0: 0x9080a610 srr1: 0x0202f030 vrsave: 0x00000000
xer: 0x20000000 lr: 0x9080a610 ctr: 0x907e4270 mq: 0x00000000
r0: 0x9080a610 r1: 0xbfffe960 r2: 0x24000245 r3: 0xa07ed3b8
r4: 0x9068d51c r5: 0x20000000 r6: 0xbfffe640 r7: 0x20000000
r8: 0x0006b010 r9: 0x0008f8e0 r10: 0x00000001 r11: 0x00000000
r12: 0x24000245 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0xa3073b98 r17: 0xa3093b98 r18: 0xa3093b98 r19: 0xa3093b98
r20: 0x00000000 r21: 0xa30a3b98 r22: 0x00000000 r23: 0x0019c810
r24: 0xa3093b98 r25: 0x00000000 r26: 0x00000100 r27: 0xbfffe9a0
r28: 0xbfffe9a8 r29: 0xa0008a58 r30: 0x00000100 r31: 0x90809e28
This tells me that Thread 0 crashed when trying the NSConcreteTask
call, right? That's about the same I knew before - when my
TaskWrapper.m has done:
// launch the task asynchronously
[task launch];
...it crashes.
Anybody?
Thanks for any input!
/Robert
On tisdag, dec 3, 2002, at 13:22 Europe/Stockholm, Yann Bizeul wrote:
>
Perhaps you could copy/paste the lines creating the NSTask to your
>
shell script.
>
Take a look to the console to see if there is any output (file not
>
found or things like that)
>
>
>
Le mardi, 3 dic 2002, ` 12:19 Europe/Paris, Robert Staflin a icrit :
>
>
> I'm trying to run shell scripts using NSTask. Even with the Apple
>
> "Moriarity" example I can't run a shell script containing the one >> line
>
>
>
> netstat -r
>
>
>
> . All "built in" commands work. Does anybody know why? The app just
>
> freezes when the task is launched.
>
>
>
> What I want to do in the long run is have more complicated shell
>
> scripts that handle all the information sorting etc, and then get the
>
> result back to my app. I guess I could pipe around the data and use
>
> multiple NSTasks from my app, but handling it in a shell scripts
>
> seems easier right now. Help, please?
>
>
>
> /Robert Staflin
>
>
>
> ==============================================
>
> KRS Consulting
>
> Robert Staflin
>
> Jenny Linds vdg 75 Tel: +46 (18)
>
> 369425
>
> S-756 50 UPPSALA Mobile: +46 (708) 369578
>
> SWEDEN
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
>
>
>
>
>
--
>
Yann Bizeul
>
TYNSOE.ORG - http://www.tynsoe.org/
>
Site technique consacri ` MacOS X
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
>
>
==============================================
KRS Consulting
Robert Staflin
Jenny Linds vdg 75 Tel: +46 (18)
369425
S-756 50 UPPSALA Mobile: +46 (708) 369578
SWEDEN
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.