hnakamur / go-scp

[Unmaintained] A scp client library written in Go
MIT License
41 stars 23 forks source link

SendDir destDir name whether end with '/' #2

Closed fugr closed 7 years ago

fugr commented 7 years ago

If trailing slash(end with '/'), so only upload the contents,if else, creating the source directory name first.

send dir A/B/C to /destDir by scp,result with /destDir/C. this PR seems works,maybe pretty way to do this.

hnakamur commented 7 years ago

Thanks for your pull request, but my understanding is that scp does not change behavior whether the destination path has the trailing slash or not.

There is no mention about trailing slash at http://manpages.ubuntu.com/manpages/xenial/en/man1/scp.1.html

Also I tested scp -r with destination paths with or without a trailing slash, and I confirmed the result was the same.

rsync does change its behavior for the source path with the trailing slash. http://manpages.ubuntu.com/manpages/xenial/en/man1/rsync.1.html

I want go-scp to be compatible with scp, so I'm afraid I cannot merge this pull request.

fugr commented 7 years ago

open new issue #3