title: Creating a new directory without mkdir()
body: <p>In C I'm using 'open()' to create and open files:</p>
  
  <pre><code>fd = open(fileName, O_CREAT | O_RDWR, 0644);
  </code></pre>
  
  <p>if 'fileName' includes a directory the file is created only if the directory exists and the application has permission to write to this directory.</p>
  
  <p>If the directory does not exists 'open()' returns an error and I would like to create the directory.</p>
  
  <p>With makedir (see below) I am able to create the directory.</p>
  
  <pre><code>int mkdir(const char *path, mode_t mode);
  </code></pre>
  
  <p>I was wondering, are there other ways to create a directory? I believe we can also use ioctl()? Are there more alternatives?</p>
  
  <p>I'm asking this because in our code we are <em>not allowed</em> to use mkdir.</p>