gaze icon indicating copy to clipboard operation
gaze copied to clipboard

[0.6.3] Event not raising when deleting a Folder

Open javorosas opened this issue 11 years ago • 1 comments

Node 0.11 node-webkit 0.9.2 gaze 0.6.3 Ubuntu 14.04

After subscribing to the changed, added, deleted and renamed events, No event is fired when I delete a folder.

Here's my code:

var Gaze = require('gaze').Gaze;
var gaze = new Gaze('**/*', { cwd: (process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE) + '/MyFolder' }, function(err, watcher) {
    if (err) {
        console.log(err);
    } else {
        // On file changed
        this.on('changed', function(filepath) {
            console.log(filepath + ' was changed');
        });

        // On file added
        this.on('added', function(filepath) {
            console.log(filepath + ' was added');
        });

        // On file deleted
        this.on('deleted', function(filepath) {
            console.log(filepath + ' was deleted');
        });

        // On renamed
        this.on('renamed', function(oldPath, newPath) {
            console.log(oldPath + ' was renamed to ' + newPath);
        });
    }
});

javorosas avatar Jun 04 '14 02:06 javorosas

I also see this.

In addition, often I get Gaze totally crashing when this happens on Linux:

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: watch ENOENT
  at exports._errnoException (util.js:746:11)
  at FSWatcher.start (fs.js:1172:11)
  at Object.fs.watch (fs.js:1198:11)
  at Gaze._watchDir (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:289:30)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:358:10
  at iterate (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:52:5)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:61:11
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:420:5
  at iterate (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:52:5)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:61:11
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:420:5
  at iterate (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:52:5)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:61:11
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:420:5
  at iterate (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:52:5)
  at Object.forEachSeries (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/helper.js:66:3)
  at Gaze._initWatched (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:354:10)
  at Gaze._internalAdd (/projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:193:10)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:400:16
  at Array.forEach (native)
  at /projects/b89f55a7-1345-453f-a45e-9de87b5213c0/dropbox/node_modules/gaze/lib/gaze.js:396:12
  at FSReqWrap.oncomplete (fs.js:95:15)

I'm on gaze 0.5.1 (the current published version), Ubuntu 15.04, kernel 3.19.0-16-generic.

swenson avatar May 25 '15 18:05 swenson