sftp.upload throws exception when... #14

Harrison-Uhl opened this Issue Aug 25, 2012 · 1 comment


None yet

2 participants


When using sftp.upload to upload a directory recursively, an exception is thrown if the destination directory(s) already exist.

Patched (only in my private copy) sftp/operations/upload.rb lines 162 and 302 to append:
|| response.code == 4 # where 4 appears to be the response code for: target directory already exists

This takes care of the problem, but I don't know the code base well enough to know if it should be done differently.

I.m using net-sftp gem v 2.0.5 on Windows. The gem was a fresh install yesterday.

Should this be handled differently? Or can someone appropriate please add these changes to the gem?



Thanks for the report. The project is in maintenance mode but I'm happy to pull in a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment