-
Notifications
You must be signed in to change notification settings - Fork 44
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
getFile in a remote folder doesn't appear to work #24
Comments
@jmaton no problem. A PR would be awesome thanks! |
jmaton, thanks for this post. I was having similar problems on my ubuntu machine getting the file from the samba server, with node giving an ENOENT error. Your changes to the getFile fixed my problem. I was having trouble understanding why the code needs a wrap function. It seem's a bit peculiar. Either way, it's needed because it can't work if I take the wrap out. Also, when I used the provided code to then find the promise had been fulfilled with an error that was caught in a catch clause, I couldn't make sense of the spawnargs and cmd properties. Below I share the values of those two properties:
I find it hard to read when the values of the command options all start with a backslash. In the SambaClient options, I write the address as //[INTERNAL_NETWORK_IP]//folder and it works. Also don't need the getFile to have a workingDirectory. I think it's fine with just the two arguments of path and destination. |
I forked, pushed, and created a pull request. Thanks again for such a wonderful library. |
fixed in #27 |
This seems to have reared up again, I'm trying to send a file from the tmp folder and it's stripping out the folder. |
First and foremost, thank you very much for this library! :-)
Consider, the address is: \\theaddress\myshare
Inside that there is a folder named "foo", and in the foo folder there is a file "bar".
I want that file so I do this:
This fails with an ENOENT. The command it's running is actually:
smbclient -U 'myuser' -c 'get bar localbar' //theaddress/myshare 'mypass' --max-protocol SMB3
i.e., it strips the folder.
This is due to the code in "runCommand"; it interprets the remote folder as the local working directory:
I tweaked getFile and sendFile slightly (and deleted runCommand) :
also in function "execute" I tweaked this line based on the pull request #20
May I check in these fixes?
Again, thank you for this library.
The text was updated successfully, but these errors were encountered: