Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Now using error code EEXIST instead of numeric error value.

  • Loading branch information...
commit a0958d956225e0d742bd99b29fa8ceb4410276f3 1 parent 1c42e72
bpedro authored

Showing 1 changed file with 17 additions and 17 deletions. Show diff stats Hide diff stats

  1. +17 17 lib/fs.js
34 lib/fs.js
@@ -7,11 +7,11 @@
7 7 osSep = process.platform === 'win32' ? '\\' : '/';
8 8
9 9 /**
10   - * Offers functionality similar to mkdir -p
11   - *
12   - * Asynchronous operation. No arguments other than a possible exception
13   - * are given to the completion callback.
14   - */
  10 + * Offers functionality similar to mkdir -p
  11 + *
  12 + * Asynchronous operation. No arguments other than a possible exception
  13 + * are given to the completion callback.
  14 + */
15 15 function mkdir_p (path, mode, callback, position) {
16 16 var parts = require('path').normalize(path).split(osSep);
17 17
@@ -28,7 +28,7 @@
28 28 mkdir_p(path, mode, callback, position + 1);
29 29 } else {
30 30 mkdirOrig(directory, mode, function (err) {
31   - if (err && err.errno != 17) {
  31 + if (err && err.code != 'EEXIST') {
32 32 return callback(err);
33 33 } else {
34 34 mkdir_p(path, mode, callback, position + 1);
@@ -57,7 +57,7 @@
57 57 mkdirSyncOrig(directory, mode);
58 58 mkdirSync_p(path, mode, position + 1);
59 59 } catch (e) {
60   - if (e.errno != 17) {
  60 + if (e.code != 'EEXIST') {
61 61 throw e;
62 62 }
63 63 mkdirSync_p(path, mode, position + 1);
@@ -66,11 +66,11 @@
66 66 }
67 67
68 68 /**
69   - * Polymorphic approach to fs.mkdir()
70   - *
71   - * If the third parameter is boolean and true assume that
72   - * caller wants recursive operation.
73   - */
  69 + * Polymorphic approach to fs.mkdir()
  70 + *
  71 + * If the third parameter is boolean and true assume that
  72 + * caller wants recursive operation.
  73 + */
74 74 fs.mkdir = function (path, mode, recursive, callback) {
75 75 if (typeof recursive !== 'boolean') {
76 76 callback = recursive;
@@ -89,11 +89,11 @@
89 89 }
90 90
91 91 /**
92   - * Polymorphic approach to fs.mkdirSync()
93   - *
94   - * If the third parameter is boolean and true assume that
95   - * caller wants recursive operation.
96   - */
  92 + * Polymorphic approach to fs.mkdirSync()
  93 + *
  94 + * If the third parameter is boolean and true assume that
  95 + * caller wants recursive operation.
  96 + */
97 97 fs.mkdirSync = function (path, mode, recursive) {
98 98 if (typeof recursive !== 'boolean') {
99 99 recursive = false;

0 comments on commit a0958d9

Please sign in to comment.
Something went wrong with that request. Please try again.