C (62/257)

From:
Date:06 Feb 2001 at 11:49:33
Subject:Re: PIPE and FIFO

Hello Fritsch

On 06-Feb-01, you wrote:

8<--- snip ---

> Is that possible? If yes, what restrictions apply to "Pipe-Files"? Can I
> as programmer seek in a pipe-file and rewind again? Lets say I want to
> read parts of a file in a non continous order. Is that possible? Can I
> read parts of that file multiple times? If yes, how does it work
> internally?

Named pipes are like regular files but they can't be accessed randomly.
Also remember that the writing program will block once the pipe has reached
4k, and will only unblock once someone starts reading the pipe. More
importantly, once data has been read from a pipe it's gone forever (which
explains the seeking problem).

On the subject of pipes, I've never understood why some programs refuse to
operate with named pipes. For example, if I

ls >PIPE:out

and then

ged PIPE:out

I don't get the output from ls in the GoldEd window. I can't understand why
there should be a problem.

Is there some special coding consideration when dealing with named pipes? I
can understand a program not handling anonymous pipes because that does
require special consideration, but a named pipe is just a regular file.

Regards

Steve

------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/981460255/
---------------------------------------------------------------------_->