[oclug] fifo named pipes and file descriptors

Greg Sarsons gsarsons at istop.com
Sun Mar 3 14:34:07 EST 2002


On Sun, 2002-03-03 at 14:25, Bart Trojanowski wrote:
> * Greg Sarsons <gsarsons at istop.com> [020303 14:15]:
> > question:
> > 
> > if I create a named pipe called /tmp/public and open it I get a file
> > descriptor of 3.
> > 
> > now if I go to another program and open /tmp/public will the file
> > descriptor be the same?  
> 
> This depends on the order of opening files by a process.  The first time
> you open a file under a new and normal process the fd will be 3.  You
> are not guaranteed this but is just the way people have implemented it.
> 
> Unless processes are related there is no correlation between an fd from
> one process and an fd from another.
> 
> B.
> 

just what I was looking for that there is no correlation between fds. 
Now I have to track down why I've somehow got a bad file descriptor on
sends :(

tks Greg 





More information about the OCLUG mailing list