forked from bchelli/node-smb2
-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
const SMB2 = require('@marsaud/smb2');
const fs =require("fs");
const smb2Client = new SMB2({
share: `\\\\000.000.000.000\\project`,
domain: 'DOMAIN',
username: 'username',
password: 'password',
});
smb2Client.createWriteStream('personal\\test10k.txt', function(err, writeStream) {
if (err) throw err;
const readStream = fs.createReadStream('/home/caocong/test10k.txt');
readStream.pipe(writeStream);
});
/usr/bin/node /home/caocong/workspace/test/index.js
node:events:342
throw er; // Unhandled 'error' event
^
Error: STATUS_PENDING (0x00000103) : The operation that was requested is pending completion.
at SMB2Forge.request (/home/caocong/workspace/test/node_modules/@marsaud/smb2/lib/tools/smb2-forge.js:22:15)
at Writable.stream._destroy (/home/caocong/workspace/test/node_modules/@marsaud/smb2/lib/api/createWriteStream.js:55:9)
at _destroy (node:internal/streams/destroy:72:23)
at Writable.destroy (node:internal/streams/destroy:64:5)
at Writable.destroy (node:internal/streams/writable:861:11)
at errorOrDestroy (node:internal/streams/destroy:242:12)
at onwriteError (node:internal/streams/writable:422:3)
at onwrite (node:internal/streams/writable:457:7)
at /home/caocong/workspace/test/node_modules/@marsaud/smb2/lib/api/createWriteStream.js:40:20
at Object.<anonymous> (/home/caocong/workspace/test/node_modules/@marsaud/smb2/lib/tools/message.js:19:15)
Emitted 'error' event on Writable instance at:
at Writable.onerror (node:internal/streams/readable:770:14)
at Writable.emit (node:events:365:28)
at emitErrorNT (node:internal/streams/destroy:193:8)
at emitErrorCloseNT (node:internal/streams/destroy:158:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
messageName: 'close',
params: {
StructureSize: Buffer(2) [Uint8Array] [ 89, 0 ],
OplockLevel: Buffer(1) [Uint8Array] [ 0 ],
Flags: Buffer(1) [Uint8Array] [ 0 ],
CreateAction: Buffer(4) [Uint8Array] [ 2, 0, 0, 0 ],
CreationTime: Buffer(8) [Uint8Array] [
24, 65, 188, 85,
11, 86, 215, 1
],
LastAccessTime: Buffer(8) [Uint8Array] [
24, 65, 188, 85,
11, 86, 215, 1
],
LastWriteTime: Buffer(8) [Uint8Array] [
24, 65, 188, 85,
11, 86, 215, 1
],
ChangeTime: Buffer(8) [Uint8Array] [
24, 65, 188, 85,
11, 86, 215, 1
],
AllocationSize: Buffer(8) [Uint8Array] [
0, 0, 0, 0,
0, 0, 0, 0
],
EndofFile: Buffer(8) [Uint8Array] [
0, 0, 0, 0,
0, 0, 0, 0
],
FileAttributes: Buffer(4) [Uint8Array] [ 32, 0, 0, 0 ],
Reserved2: Buffer(4) [Uint8Array] [ 0, 0, 0, 0 ],
FileId: Buffer(16) [Uint8Array] [
199, 131, 249, 165, 0, 0,
0, 0, 117, 59, 179, 28,
0, 0, 0, 0
],
CreateContextsOffset: Buffer(4) [Uint8Array] [ 0, 0, 0, 0 ],
CreateContextsLength: Buffer(4) [Uint8Array] [ 0, 0, 0, 0 ],
Buffer: Buffer(0) [Uint8Array] []
},
code: 'STATUS_PENDING'
}
I found out the reason is async request. But I don't know how to do.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels