Commit fd95d450 authored by Julien Fontanet's avatar Julien Fontanet

fix(mkdir): dont test existence

Similar to 4b8f5754
parent 72971e9c
...@@ -20,14 +20,8 @@ module.exports = function mkdir(path, mode, cb) { ...@@ -20,14 +20,8 @@ module.exports = function mkdir(path, mode, cb) {
var connection = this; var connection = this;
connection.exists(path, function(err, exists) {
if (err) cb && cb(err);
else if (!exists) {
// SMB2 open file // SMB2 open file
SMB2Request('create_folder', { path: path }, connection, function( SMB2Request('create_folder', { path: path }, connection, function(err, file) {
err,
file
) {
if (err) cb && cb(err); if (err) cb && cb(err);
// SMB2 query directory // SMB2 query directory
else else
...@@ -35,8 +29,4 @@ module.exports = function mkdir(path, mode, cb) { ...@@ -35,8 +29,4 @@ module.exports = function mkdir(path, mode, cb) {
cb && cb(null); cb && cb(null);
}); });
}); });
} else {
cb(new Error('File/Folder already exists'));
}
});
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment