Returns a write stream on the file. Unlike fs.createWriteStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.
Example:
...
...
@@ -165,6 +165,8 @@ smb2Client.createWriteStream('path\\to\\the\\file', function (err, readStream) {
readStream.pipe(writeStream)
});
```
### smb2Client.ensureDir ( path, callback )
Ensures that the directory exists. If the directory structure does not exist, it is created.
if(fileOrDir.FileAttributes.readIntBE(0,1)===0x00000010){// See http://download.microsoft.com/DOWNLOAD/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/[MS-FSCC].pdf Section 2.6
awaitrequestAsync('close',fileOrDir,connection)
}else{
thrownewError(`${path} exists but is not a directory`)