I'm working sometimes (more often that I'd like to) with such workflow that I'm editing local files and immediately uploading them to server and watching changes on live server. It was quite easy to configure on Windows using WinSCP or on Mac using some custom nodejs watcher / uploader (
https://github.com/hitsthings/node-live-ftp-upload ). I want to achieve similar immediate-upload effect with Yummy FTP Watcher, but unfortunately it doesn't work.
It seems those other programs are using FS system events for being notified that file was changed so they can in that way upload them with 0 delay. Yummy seems to use mechanism of rescanning folders every X seconds/minutes which must be obviously slower. Event when I set up watched for 'rescan every 1 second' the delays become sometimes really long (5 seconds or longer).
Am I missing something? If not can you implement real immediate upload feature? I think no other mac program has that so that would be great feature for Yummy FTP watcher. I shouldn't be also to difficult since such a short node script achieves that
Below are the lines which achieve file system events in real time for the mentioned node script.
function watchRecursive(dir, opts, onchange, cb) {
fs.watch(dir, opts, function(event, filename) {
onchange(event, filename, path.join(dir, filename));
});
fs.readdir(dir, function(err, files) {
function recurse(file, cb) {
file = path.join(dir, file);
fs.stat(file, function(err, stat) {
if (err) return cb(err);
if (stat.isDirectory()) {
return watchRecursive(file, opts, onchange, cb);
}
return cb();
});
}
async.each(files, recurse, cb);
});
}