title: Making fifo in C
body: <p>I have two problems with my code.</p>
  
  <p>First problem is that once I create a fifo, I don't know how to add a condition in the code so in future running, if the fifo exists - then just don't create it. Tried to google, "access" didn't work (it just stucked on there and didn't continue).</p>
  
  <p>My second problem is, that the code is stuck in the "open("MyFifo..." line, even if it's the first time after I created the fifo (meaning I just created the fifo, mkfifo succeed, and I reach open() line - it's stuck there).</p>
  
  <pre><code>//create new fifo
  if(mkfifo("myFifo",0666)&lt;0)
  {
      perror("fifo creation failed.");
      exit(1);
  }
  
  //get fifo fd
  if((fd=open("myFifo",O_RDONLY))==-1)
  {
      perror("failed opening fifo.");
      exit(1);
  }
  </code></pre>
  
  <p>Any ideas what am I doing wrong?</p>