Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clobber mode issue #64

Open
redgecombe opened this issue Oct 8, 2014 · 1 comment
Open

Clobber mode issue #64

redgecombe opened this issue Oct 8, 2014 · 1 comment

Comments

@redgecombe
Copy link

There seems to be an issue copying a directory over another directory using clobber mode. I am finding that intermittently the completion callback is never triggered.

I did a little digging and saw that the "running" count becomes negative in my case.

I think the issue is in the onFile function here:

      if(clobber) {
        rmFile(target, function () {
          copyFile(file, target);
        });
      }
      if (modified) {
        var stat = dereference ? fs.stat : fs.lstat;
        stat(target, function(err, stats) {
            //if souce modified time greater to target modified time copy file
            if (file.mtime.getTime()>stats.mtime.getTime())
                copyFile(file, target);
            else return cb();
        });
      }

If clobber is true, there can be two calls to copyFile, eventually causing two calls to cb, resulting in the started/finished/running counts getting out of sync. I think this is related to this change:
85cd50a

Thanks

@coderaiser
Copy link
Contributor

Fixed in #68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants