get(filePath) no longer returning a buffer
See original GitHub issueEDIT: 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:
- Created a year ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
v9.0.1 pushed