LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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, 06: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, 10: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, 08:52 PM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:42 PM
C(sockets):how to implement persistent and pipeline supermyself Programming 0 06-09-2005 01:42 PM
Having a tough time with K-shell pipeline pjz Programming 4 03-24-2005 04:05 PM
pipeline using rm verstapp Linux - General 3 03-09-2004 12:33 AM
Pipeline implementation in C jiahe Programming 1 02-02-2003 06:23 AM


All times are GMT -5. The time now is 03:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration