Permalink
Browse files

Merge pull request #9 from naholyr/patch-3

Create a WriteStream instead of emitting an error on non-existing file
  • Loading branch information...
2 parents e1bfe58 + fbf5b5f commit a6346ee2a30cb4e7a58f2864b0e21df401073aad @mikeal committed Oct 31, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 main.js
View
@@ -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)

0 comments on commit a6346ee

Please sign in to comment.