Author Topic: Make uploads really immediate - possible?  (Read 1004 times)

chodorowicz

  • Jr. Member
  • **
  • Posts: 3
Make uploads really immediate - possible?
« on: April 18, 2015, 11:25:35 AM »
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.

Code: [Select]
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);
    });
}

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2674
Re: Make uploads really immediate - possible?
« Reply #1 on: April 18, 2015, 01:51:53 PM »
Just for the record, there is a lot more to it than just those few lines, or at least it is for me in Xcode developing for OS X. If was trivial I would have added it already, believe me ;)

I have this on my To Do list as an enhancement for the very near future!

chodorowicz

  • Jr. Member
  • **
  • Posts: 3
Re: Make uploads really immediate - possible?
« Reply #2 on: April 18, 2015, 02:29:26 PM »
Sweet! I'll be waiting for this feature impatiently ;)

Heh, I have zero Xcode experience so, yeah, as you say, most probably it's more difficult.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2674
Re: Make uploads really immediate - possible?
« Reply #3 on: May 29, 2015, 12:20:49 PM »
Good news! Coming soon ;)

chodorowicz

  • Jr. Member
  • **
  • Posts: 3
Re: Make uploads really immediate - possible?
« Reply #4 on: May 31, 2016, 12:20:42 AM »
Any new on that? It'd be still a veeeery welcome addition.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2674
Re: Make uploads really immediate - possible?
« Reply #5 on: May 31, 2016, 08:01:56 AM »
You should see a huge improvement in v2.2.7 if the FSEvents option is enabled in your Watcher setup?