[LCP]buffering problem

Bill Rausch William.Rausch at numerical.com
Sat Sep 7 17:31:05 UTC 2002


At 2:57 AM +1000 9/4/02, Lucas King wrote:
>hello,
>
>"Programs using the standard I/O library provided by UNIX 
>automatically buffer their output when running non-interactively. 
>This causes problems when you need to see the output immediately." 
>... it is possible "to make the programs think they are running 
>interactively, thereby resolving the buffering problem."
>
>the above is an exerpt from a manual.  the problem is, it doesn't go 
>on to explain how to make a program, e.g. FTP, think that it is 
>running interactively.
>
>i would dearly like to know how.
>
>as with my Telnet session i am attempting to write a small 
>interactive FTP session in C.  the problem is that FTP is not 
>passing the prompt "ftp>" (because it is not terminated by a newline 
>character) through to my process, thereby making it difficult to 
>determine when it is ready for further commands.
>
>if anyone has any thoughts on the matter......
>
>thanking you in advance,
>
>Lucas King

Check out the program "expect".  I believe its source code is 
available and I think it does everything you want (for your ftp 
question and the telnet question).

For starters:  http://www.linuxjournal.com/article.php?sid=3065

>
>
>
>************************************************************************
>This email and any files transmitted with it may be legally 
>privileged and confidential.  If you are not the intended recipient 
>of this email,
>you must not disclose or use the information contained in it.  If 
>you have received this email in error, please notify us by return 
>email and permanently delete the document.
>************************************************************************
>
>
>_______________________________________________
>This is the Linux C Programming List
>:  http://lists.linux.org.au/listinfo/linuxcprogramming List


-- 
Bill Rausch, Software Development, UNIX, Mac, Windows
Numerical Applications, Richland, WA  509-943-0861 x302




More information about the linuxCprogramming mailing list