Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Create a WriteStream instead of emitting an error on non-existing file #9

Merged
merged 1 commit into from

2 participants

@naholyr

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

@naholyr naholyr 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
fbf5b5f
@mikeal mikeal merged commit a6346ee into mikeal:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 30, 2011
  1. @naholyr

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

    naholyr authored
    …("non-existing-file")`. Beware this will stick to documentation, but it will create a file (as `fs.createWriteStream` does).
    
    REFS #8
This page is out of date. Refresh to see the latest.
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)
Something went wrong with that request. Please try again.