Commit fd95d450 authored by Julien Fontanet's avatar Julien Fontanet

fix(mkdir): dont test existence

Similar to 4b8f5754
parent 72971e9c
......@@ -20,23 +20,13 @@ module.exports = function mkdir(path, mode, cb) {
var connection = this;
connection.exists(path, function(err, exists) {
// SMB2 open file
SMB2Request('create_folder', { path: path }, connection, function(err, file) {
if (err) cb && cb(err);
else if (!exists) {
// SMB2 open file
SMB2Request('create_folder', { path: path }, connection, function(
err,
file
) {
if (err) cb && cb(err);
// SMB2 query directory
else
SMB2Request('close', file, connection, function() {
cb && cb(null);
});
// SMB2 query directory
else
SMB2Request('close', file, connection, function() {
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