question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

get(filePath) no longer returning a buffer

See original GitHub issue

EDIT: This has been resolved in this commit. Leaving open until 9.0.1 is live.

Windows 10 Node 16.14.0 ssh2-sftp-client 9.0.0 (working in 8.1.0)

Running ssh2-sftp-client 9.0.0 and attempting a simple get() call in hopes of receiving a buffer.

let buf = await sftp.get(filePath); console.log('Buffer: ' + Buffer.isBuffer(buf )); // true in 8.1, false 9.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
theophilusxcommented, Jun 15, 2022

Good catch!

Problem was a timing issue between calls to resolve(). The call to resolve which returns the writer object was firing before the call to resolve which returns the concat-stream buffer object. So the buffer of data you were after was being returned, but inside of a concat-stream object instead of just the buffer itself.

Have pushed a fix to master. Would be good if you could try it out and see if it addresses your issue. If it does, I will push out 9.0.1

0reactions
theophilusxcommented, Jun 21, 2022

v9.0.1 pushed

Read more comments on GitHub >

github_iconTop Results From Across the Web

readFileSync not returning buffer when giving dynamic ...
1 Answer 1 · Hey, I am still not able to getting response, code you mentioned is giving response like, File name: /home/***/public/receipt/jainam ......
Read more >
spacemacs/copy-file-path no longer prints file path to ... - GitHub
SPC f y y returns the current files path for me in both Ubuntu 18.04.02 and Windows 10 Version 1803 both in the...
Read more >
Filepath Or Buffer - Data Profiler v0.6.0
Context manager class used for inputing a file or buffer and returning a structure that is always a buffer. Flush and close the...
Read more >
getcwd() — Get path name of the working directory - IBM
If successful, getcwd() returns a pointer to the buffer. If unsuccessful, getcwd() returns a NULL pointer and sets errno to one of the...
Read more >
GetFullPathNameW function (fileapi.h) - Win32 apps
A pointer to a buffer that receives the address (within lpBuffer) of the final file name component in the path. This parameter can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found