[lug] named pipe missunderstanding

Lori Reed lorireed at lightning-rose.com
Wed Feb 2 16:13:34 MST 2011


My apologies. It's been a while since I used pipes. popen(3) is for 
un-named pipes.

Named pipes are created before use by either the mknod(1) or mkfifo(1) 
shell commands, or the mknod(2,3) and mkfifo(3) function calls.

Before running your Java code did you run the mkfifo command in the 
shell? If not, that may be the source of your trouble.

http://linux.die.net/man/1/mkfifo
http://linux.die.net/man/3/mkfifo

Lori


On 02/02/2011 02:23 PM, Jason Davis wrote:
> http://developers.sun.com/solaris/articles/named_pipes.html
>
> Opening a Named Pipe
>
> A named pipe can be opened for reading or writing, and it is handled
> just like any other normal file in the system. For example, a named
> pipe can be opened by using the open() system call, or by using the
> fopen() standard C library function.
>
> As with normal files, if the call succeeds, you will get a file
> descriptor in the case of open(), or a 'FILE' structure pointer in the
> case of fopen(), which you may use either for reading or for writing,
> depending on the parameters passed to open() or to fopen().
>
> Therefore, from a user's point of view, once you have created the
> named pipe, you can treat it as a file so far as the operations for
> opening, reading, writing, and deleting are concerned.
>
>
>
> Hope someone tells the solaris developers...
>
>
> On Wed, Feb 2, 2011 at 2:17 PM, Lori Reed<lorireed at lightning-rose.com>  wrote:
>> On 02/02/2011 02:08 PM, Jason Davis wrote:
>>
>>> Seems to work fine if I keep the connection open. Writing and reading
>>> work as expected. I dont plan on trying to seek() or do other file
>>> operations. What exactly can I not rely on?
>>
>> It working.
>>
>> L.
>> _______________________________________________
>> Web Page:  http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>



More information about the LUG mailing list