Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smb2Client.open('test.txt', 'w' ... is error #75

Open
binghe17 opened this issue Feb 25, 2021 · 0 comments
Open

smb2Client.open('test.txt', 'w' ... is error #75

binghe17 opened this issue Feb 25, 2021 · 0 comments

Comments

@binghe17
Copy link

binghe17 commented Feb 25, 2021

---------- demo_samba.js

...

smb2Client.open('test.txt', 'w', function(err, fd) {
if (err) throw err;

  smb2Client.write(
      fd, // file descriptor
      Buffer.from('asdf'), // data to write to the file
      0, // offset in the buffer
      10, // number of bytes to write
      0, // offset in the file
      function(err, bytesWritten, buffer) {
          smb2Client.close(fd, function() {});

          if (err) throw cb(err);
          console.log(bytesWritten);
      }
  );

});


`
PS C:\Users\USERNAME\Desktop\node\test\image-download-main> node demo_samba.js
assert.js:383
throw err;
^

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

assert(offset > 0)

    at module.exports.write (C:\Users\USERNAME\Desktop\node\test\image-download-main\node_modules\@marsaud\smb2\lib\api\write.js:13:5)
    at module.exports.write (C:\Users\USERNAME\Desktop\node\test\image-download-main\node_modules\@marsaud\smb2\lib\tools\auto-promise.js:30:8)
    at C:\Users\USERNAME\Desktop\node\test\image-download-main\demo_samba.js:177:16
    at C:\Users\USERNAME\Desktop\node\test\image-download-main\node_modules\@marsaud\smb2\lib\tools\smb2-connection.js:153:8
    at Object.04000000 (C:\Users\USERNAME\Desktop\node\test\image-download-main\node_modules\@marsaud\smb2\lib\tools\message.js:15:15)
    at Socket.<anonymous> (C:\Users\USERNAME\Desktop\node\test\image-download-main\node_modules\@marsaud\smb2\lib\tools\smb2-forge.js:71:31)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant