Re: [linux-audio-dev] re: less and seeking on piped input

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] re: less and seeking on piped input
From: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: pe elo    20 1999 - 07:15:23 EDT


David Slomin wrote:

<snip>

> BTW, Erik, getting pipes to work is really trivial if you already have
> code that reads a file (sequentially, not random access). Just do an
> fdopen on file descriptor zero, and you're done.

Or use variables stdin/stdout as the FILE* parameter for fread/frwrite.

> You can also test the limits of what pipes can do without modifying your
> code at all by using named pipes (fifos). These are wonderful but often
> overlooked "files" (in the manner that devices are "files") which you can
> open for reading and writing at once by different apps. Take a look at
> the mkfifo man page. I have no idea why they're not used more often.

Good idea.

I've actually used them before. I have a little daemon program running
which writes to a named pipe (".signature") in my home directory.
Whenever
I send mail or a newsgroup posting Netscape reads this file and the
daemon
then writes a new message to the named pipe. Kind of cute.

Erik

-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd_AT_zip.com.au
+-------------------------------------------------+
Linux: generous programmers from around the world all join
forces to help you shoot yourself in the foot for free.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:25:52 EST