spmjs / node-scp2

[MAINTAINER WANTED] A pure javascript scp program based on ssh2.
384 stars 96 forks source link

Empty file created on NO_SUCH_FILE error #51

Open ggutenberg opened 8 years ago

ggutenberg commented 8 years ago

Using the following type of call:

client.scp({
    host: 'example.com',
    username: 'admin',
    password: 'password',
    path: '/home/admin/file.txt'
}, './', function(err) {})

When an attempt to copy a file that doesn't exist occurs, the err object in the callback function has a type property of NO_SUCH_FILE. This is great. However an empty file is still created at the target location. How do I stop this from happening?