title: FIFOs in C (Named-pipes)
body: <p>I'm getting permission errors when trying to <code>mkfifo()</code> in the current directory. I definitely have permission to create files here. Any idea what the problem could be?</p>
  
  <pre><code>char dir[FILENAME_MAX];
  getcwd(dir, sizeof(dir));
  
  
  for(i = 0; i&lt;num_nodes; i++)
  {
      char path[FILENAME_MAX];
      sprintf(path, "%s/%d",dir, i);
      printf("%s\n", path);
      fifoArray[i] = mkfifo(path, O_WRONLY);
      if(fifoArray[i] &lt; 0)
      {
           printf("Couldn't create fifo\n");
           perror(NULL);
      }
  }
  </code></pre>