I'm just wondering whether it is at all possible to transfer a directory from a unix server to my local machine using the ssh2 module in node.js. I have connected to the remote host and can read the directory as well as transfer single files, but there are 28 folders in the directory which each contain files and sub directories. What I'd like to do is take an exact copy of the main directory from the server to my local machine.
I was using fastGet with single files, but transferring a directory gives: Error: EISDIR, open __dirname/../localdirectory/
which I think implies I can't use fastGet to get an entire directory. I also tried using the exec command to try and scp it over, but I couldn't work out the syntax for the local directory:
// c is an active connection
c.exec('scp filethatexists.extension /../filepath/newname.extension', function(err, stream) {
if (err) {
console.log("error: " + err);
stream.end;
};
stream.on('data', function(data, extended) {
console.log((extended === 'stderr' ? 'STDERR: ' : 'STDOUT: ') + data);
});
stream.on('end', function() {
console.log('Stream :: EOF');
});
stream.on('close', function() {
console.log('Stream :: close');
});
stream.on('exit', function(code, signal) {
console.log('Stream :: exit :: code: ' + code + ', signal: ' + signal);
c.end();
});
});
This just results in the EOF calling. This code was just me testing If I could get a single file transferring.
Can anyone provide me with any assistance? Thank you in advance.
Well, I have some function that invokes via ng-click. For example, this function set variable a to true, and after few seconds variable should become false. Function looks like this one: $scope.do =...
Well, I have some function that invokes via ng-click. For example, this function set variable a to true, and after few seconds variable should become false. Function looks like this one: $scope.do =...
I have combed through the sp namespace docs and not found much to go on. I found this snippet from http://www.c-sharpcorner.com/Blogs/12134/how-to-get-the-list-content-types-using-csom-in-sharepoint-...
I have combed through the sp namespace docs and not found much to go on. I found this snippet from http://www.c-sharpcorner.com/Blogs/12134/how-to-get-the-list-content-types-using-csom-in-sharepoint-...
I'm trying to accomplish a hover animation using JS, but my skills with said language are very limited. I have this script in my script.js file, as it is the only script I'm using: $(document).ready(...
I'm trying to accomplish a hover animation using JS, but my skills with said language are very limited. I have this script in my script.js file, as it is the only script I'm using: $(document).ready(...
I am trying to configure a custom context menu for jsTree. I want files to have two options [Rename, Delete] and I want folders to have one option [Create] The below code seems correct as described ...
I am trying to configure a custom context menu for jsTree. I want files to have two options [Rename, Delete] and I want folders to have one option [Create] The below code seems correct as described ...