title: writeFile no such file or directory
body: <p>I have a file(<code>data.file</code> an image), I would like to save this image. Now an image with the same name <em>could</em> exist before it. I would like to overwrite if so or create it if it does not exist since before. I read that the flag "w" should do this.</p>
  
  <p>Code:</p>
  
  <pre class="lang-js prettyprint-override"><code>fs.writeFile('/avatar/myFile.png', data.file, {
    flag: "w"
  }, function(err) {
    if (err) {
      return console.log(err);
    }
    console.log("The file was saved!");
  });
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <pre><code>[Error: ENOENT: no such file or directory, open '/avatar/myFile.png']
  errno: -2,
    code: 'ENOENT',
      syscall: 'open',
        path: '/avatar/myFile.png'
  </code></pre>
  </blockquote>