Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now using error code EEXIST instead of numeric error value.

  • Loading branch information...
commit a0958d956225e0d742bd99b29fa8ceb4410276f3 1 parent 1c42e72
bpedro authored
Showing with 17 additions and 17 deletions.
  1. +17 −17 lib/fs.js
View
34 lib/fs.js
@@ -7,11 +7,11 @@
osSep = process.platform === 'win32' ? '\\' : '/';
/**
- * Offers functionality similar to mkdir -p
- *
- * Asynchronous operation. No arguments other than a possible exception
- * are given to the completion callback.
- */
+ * Offers functionality similar to mkdir -p
+ *
+ * Asynchronous operation. No arguments other than a possible exception
+ * are given to the completion callback.
+ */
function mkdir_p (path, mode, callback, position) {
var parts = require('path').normalize(path).split(osSep);
@@ -28,7 +28,7 @@
mkdir_p(path, mode, callback, position + 1);
} else {
mkdirOrig(directory, mode, function (err) {
- if (err && err.errno != 17) {
+ if (err && err.code != 'EEXIST') {
return callback(err);
} else {
mkdir_p(path, mode, callback, position + 1);
@@ -57,7 +57,7 @@
mkdirSyncOrig(directory, mode);
mkdirSync_p(path, mode, position + 1);
} catch (e) {
- if (e.errno != 17) {
+ if (e.code != 'EEXIST') {
throw e;
}
mkdirSync_p(path, mode, position + 1);
@@ -66,11 +66,11 @@
}
/**
- * Polymorphic approach to fs.mkdir()
- *
- * If the third parameter is boolean and true assume that
- * caller wants recursive operation.
- */
+ * Polymorphic approach to fs.mkdir()
+ *
+ * If the third parameter is boolean and true assume that
+ * caller wants recursive operation.
+ */
fs.mkdir = function (path, mode, recursive, callback) {
if (typeof recursive !== 'boolean') {
callback = recursive;
@@ -89,11 +89,11 @@
}
/**
- * Polymorphic approach to fs.mkdirSync()
- *
- * If the third parameter is boolean and true assume that
- * caller wants recursive operation.
- */
+ * Polymorphic approach to fs.mkdirSync()
+ *
+ * If the third parameter is boolean and true assume that
+ * caller wants recursive operation.
+ */
fs.mkdirSync = function (path, mode, recursive) {
if (typeof recursive !== 'boolean') {
recursive = false;
Please sign in to comment.
Something went wrong with that request. Please try again.