Closed kenichi-shibata closed 9 years ago
Yes but how do you implement mkdir() if the dir does not exists?
I'm afraid I don't understand what the problem is. Are you asking about recursively making a directory on the remote side, like mkdir -p
does, or something else?
Yes something like mkdir -p but it should not make a directory if it already exists and should log that the directory exists.
This is fixed by #80 Thanks Brian!
How do you Implement mkdir if directory does not exists? I tried using fs like this
c.on('ready', function() { if (!fs.existsSync(REMOTE_DIRECTORY)){ fs.mkdir(REMOTE_DIRECTORY);} c.put(LOCAL_FILE,REMOTE_DIRECTORY+REMOTE_FILE, function(err) { if (err) throw err; console.log('successfully uploaded file'); c.end(); }); });
probably i cannot do it like this because it is already connected to the ftp Can you make a function that mkdir if not exists? Please :)
Thanks Brian!