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 > setting environment for nstask

setting environment for nstask
Thread Tools
seb2
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Dec 4, 2001, 05:22 PM
 
hi everybody,

i have this small app that reads in data from /bin/ps. ps by default limits its output width to the screen/window width. i tried setting the environment for the task that launches ps, but its output still gets truncated. the nsdictionary i hand to the task looks like this:

dict = [NSDictionary dictionaryWithObject:@"co#200:" forKey:@"TERMCAP"];

am i missing something fundamental?
     
fitter
Senior User
Join Date: Jan 2000
Status: Offline
Reply With Quote
Dec 4, 2001, 05:32 PM
 
As a stopgap measure, you could pass the -w flag to ps before you launch the task, which will prevent truncation in most cases. Haven't tested it, but it seems reasonable.
     
seb2  (op)
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Dec 4, 2001, 06:38 PM
 
Originally posted by fitter:
<STRONG>As a stopgap measure, you could pass the -w flag to ps before you launch the task, which will prevent truncation in most cases. Haven't tested it, but it seems reasonable.</STRONG>
wow, thanks a lot!
in fact, specifying w once limits ps's output to 132 characters line width and specifying it more than once makes the output as wide as necessary. missed that in the man page.

still, out of curiosity, what did i do wrong in the example above?
     
   
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
Top
Privacy Policy
All times are GMT -4. The time now is 03:57 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,