smb2c
Version:
SMB2 Client from marsaud-smb2 0.7.2
30 lines (23 loc) • 513 B
JavaScript
var SMB2Forge = require('../tools/smb2-forge')
, SMB2Request = SMB2Forge.request
;
/*
* exists
* ======
*
* test the existence of a file
*
* - try to open the file
*
* - close the file
*
*/
module.exports = function(path, cb){
var connection = this;
SMB2Request('open', {path:path}, connection, function(err, file){
if(err) cb && cb(null, false);
else SMB2Request('close', file, connection, function(err){
cb && cb(null, true);
});
});
}