Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSTask - works in command line, not in code

NSTask - works in command line, not in code
Thread Tools
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Sep 12, 2003, 10:25 AM
 
I'm learning about NSTask at the moment, because I'd like to wrap a few shell commands in my app.

The command I'd like to run is a perl script which is part of a package installed by Fink.

When I run the script in the terminal all is well, but when I try to run it as an NSTask I get the error below:

Is it because the Shell has extra Environment stuff going on? I'm not entirely familiar with what the "environment" is exactly.

2003-09-12 16:21:15.128 TVList[2899] update listings...
Can't locate LWP/Simple.pm in @INC (@INC contains: /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at /sw/bin/tv_grab_uk line 71.
BEGIN failed--compilation aborted at /sw/bin/tv_grab_uk line 71.
2003-09-12 16:21:15.370 TVList[2899] Task status: 2.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Sep 12, 2003, 11:31 AM
 
Solved - I did some reading about Environment Variables, tweaked my code and all is now well.

Why is it that the action of Writing a post can often get you thinking on the right track again?
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Sep 12, 2003, 08:43 PM
 
Who knows...but yes, it often seems to do that.

:]
[Wevah setPostCount:[Wevah postCount] + 1];
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2