LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-16-2004, 05:41 PM   #1
jk3us
LQ Newbie
 
Registered: Dec 2004
Distribution: Debian, SuSE
Posts: 6

Rep: Reputation: 0
pipeline buffering


I am having the problem of programs in a pipeline (or redirect) having their output buffered by stdio. I've seen a few people suggest that expect could be used to make the program think it's running on a pty. Can anyone give me an example of this?
 
Old 12-17-2004, 09:15 AM   #2
jk3us
LQ Newbie
 
Registered: Dec 2004
Distribution: Debian, SuSE
Posts: 6

Original Poster
Rep: Reputation: 0
anyone?

anyone know?
 
Old 12-17-2004, 07:52 PM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
I don't think I quite understand the question.

If you use the low-level read(2) and write(2) system calls, then you will always get unbuffered I/O. If you use the libc functions fread(3) and fwrite(3) then you will get line-buffered I/O, at least by default. You can use setbuf() to control buffering on stdin and stdout.

expect(1) is a program that interacts with another program by reading it's standard output stream and writing to its standard input stream, buffered or not. Is this what you're wanting to do? Or are you trying to pipe a stream without buffering it?
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
noob Pipeline help. promero Programming 8 09-11-2005 03:42 PM
C(sockets):how to implement persistent and pipeline supermyself Programming 0 06-09-2005 12:42 PM
Having a tough time with K-shell pipeline pjz Programming 4 03-24-2005 03:05 PM
pipeline using rm verstapp Linux - General 3 03-08-2004 11:33 PM
Pipeline implementation in C jiahe Programming 1 02-02-2003 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration