Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

pipe created with wrong name

SOLVED
Go to Solution
Occasional Visitor

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.

1 ACCEPTED SOLUTION
Occasional Visitor

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.

2 REPLIES
Occasional Visitor

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 Acclaimed Contributor

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.)