pipe created with wrong name (208 Views)
Reply
Occasional Visitor
nasmork128
Posts: 2
Registered: ‎04-15-2013
Message 1 of 3 (208 Views)
Accepted Solution

pipe created with wrong name

Hi Guys! 

Facing the problem when pipe (IPC) I'm creating using open(...) method is created in the wrong way. Pipe character ('|') is being appended to the name I give. 
When I run my program I get this file created:

....
prw-r----- 1 aleks cortex 0 Apr 15 14:15 832081|

while the name I use is /home/aleks/tmp/832081. I have checked the string I'm usign as a pipe name. 

Here is a code snippet:

short open_for_resp( void )
{
   int fd;

   /* NOTE: open on a pipe with RDONLY waits until there */
   /* is a writer on the other end - how convenient ! */
   fprintf(stderr, "YOPT [%s]", M_fifonm);
   fd = open(M_fifonm, O_RDONLY);
   ...
}

Output I get:
YOPT [/home/aleks/tmp/832081]

 

Any help would be appreciated.

Occasional Visitor
nasmork128
Posts: 2
Registered: ‎04-15-2013
Message 2 of 3 (203 Views)

Re: pipe created with wrong name

Sorry guys! Seems like ls gives me this output to identify the pipe. Thanks to all. The problem is solved.

Acclaimed Contributor
Dennis Handly
Posts: 25,198
Registered: ‎03-06-2006
Message 3 of 3 (169 Views)

Re: ls adds a "|" to the end of a pipe

[ Edited ]

>ls gives me this output to identify the pipe.

 

That's correct.  Using "ls -F" will add a variety of chars to identify pipes, executables, directories and symlinks.

(Also your snippet didn't show the mknod(2) call.)

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.