Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create a WriteStream instead of emitting an error when calling `filed…

…("non-existing-file")`. Beware this will stick to documentation, but it will create a file (as `fs.createWriteStream` does).

REFS #8
  • Loading branch information...
commit fbf5b5f323192f9329e3a022cbde4ee5f8b77f8e 1 parent e1bfe58
@naholyr naholyr authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  main.js
View
1  main.js
@@ -43,6 +43,7 @@ function File (options) {
fs.stat(options.path, function (err, stats) {
var finish = function (err, stats) {
+ if (err && err.code === 'ENOENT' && !self.dest && !self.src) self.src = self.path
if (err && !self.dest && !self.src) return self.emit('error', err)
if (err && self.dest && !self.dest.writeHead) return self.emit('error', err)
Please sign in to comment.
Something went wrong with that request. Please try again.