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 > NSPipe for interactive commands

NSPipe for interactive commands
Thread Tools
thesearcher
Dedicated MacNNer
Join Date: Mar 2002
Status: Offline
Reply With Quote
Jun 9, 2002, 09:24 PM
 
Is NSPipe suitable for wrapping interactive commands, eg. sftp? If not, is there something that is?
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jun 11, 2002, 06:48 AM
 
NSPipe can be used for that sort of thing, I think, but it's not always exactly simple. I've tried a couple of times to make a wrapper for ftp, and capturing stdout right is tricky for some reason. It keeps not wanting to print to stdout until it terminates, and then it has trouble printing file listings of more than a few lines. I think this is the sort of thing NSPipes are for, though, so I assume I'm just not doing something right. I'll have to go over my code later to see if I can find out what's going wrong.

Anyway, sorry for not being especially helpful. I don't know that much about them, but I figured any response would probably be more informative than none.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
LordJavac
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status: Offline
Reply With Quote
Jun 11, 2002, 06:15 PM
 
The problem with FTP might lie in the environment rather than in NSPipe. Some terminal applications query the terminal (stdout) for its dimensions before writing out to it. Since you're supplying a pipe, rather than a terminal connection (tty and its ilk), FTP may have no idea how big the output "screen" is. There are usually some environment variables that are used to make such determinations, first is the TERM variable which can be used to tell what kind of terminal emulation is supported, and secondly are the ROWS and COLS (I think that's what their called) variables that store the dimension of the terminal. I hope this helps as a starting point for solving your problem.
     
   
 
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 05:08 PM.
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.,