title: nodejs in windows file system path error 4058 ENOENT
body: <p>I am using <a href="https://nodejs.org/api/fs.html#fs_readstream_path" rel="nofollow">file system with nodejs</a> in <code>windows</code> to write process logs. I have follwing code</p>
  
  <pre><code>var fs = require('fs');
  var config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
  var statusLogStream = fs.createWriteStream("../logs/load stat"+(new Date())+".log");
  </code></pre>
  
  <p>It turns out with an error </p>
  
  <pre><code>    { [Error: ENOENT: no such file or directory, open 'C:\proc\logs\load stat Mon Apr 18 2016 19:09:32 GMT+0530 (India Standard Time).log']
    errno: -4058,
    code: 'ENOENT',
    syscall: 'open',
    path: 'C:\\proc\\logs\\load stat Mon Apr 18 2016 19:09:32 GMT+0530 (India Standard Time).log' }
  events.js:141
        throw er; // Unhandled 'error' event
    ^
  </code></pre>
  
  <p>I try the folder to open the file manually <code>C:\\proc\\logs</code> it doesn't work and <code>C:/proc/logs</code> this when I replace double backward slash by forward slash I can manually open the folder from explorer. </p>
  
  <p>How to make it working</p>
  
  <p>Why is it taking the <code>double backward slash</code> instead of <code>forward slash</code></p>
  
  <p><strong>IMP: The above code works perfectly fine in <code>linux ubuntu</code> server but not in <code>windows</code></strong></p>