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

fs.lstatSync doesn't handle specific Windows REPARSE POINTS #239

Open
paulbouwer opened this issue Apr 29, 2017 · 0 comments
Open

fs.lstatSync doesn't handle specific Windows REPARSE POINTS #239

paulbouwer opened this issue Apr 29, 2017 · 0 comments

Comments

@paulbouwer
Copy link

paulbouwer commented Apr 29, 2017

  • OS version and name: Windows 10 (16179)
  • gaze version: 1.1.2

Referenced issues:

Issue

After experiencing the following issue in hyper which uses gaze, I noticed that all sub-folders in my HOME were being scanned instead of just the HOME/.hyper.js file that hyper had configured gaze to watch.

image

It also appears that in my case, the OneDrive folder has a specific type of reparse point that fs.lstatSync cannot handle. I ran a simple app against my home folder and fs.lstatSync will handle all other junctions in my HOME, just not the folders added by OneDrive.

Would it make sense to alter:

gaze.js - line 301-303

301      if (fs.lstatSync(dirfile).isDirectory()) {
302        helper.objectPush(this._watched, dirname, dirfile + path.sep);
303      }

to the following:

301      try {
302        if (fs.lstatSync(dirfile).isDirectory()) {
303          helper.objectPush(this._watched, dirname, dirfile + path.sep);
304        }
305      } catch (e) { }

or only catch the error if e.code === "EINVAL". At least until this can be resolved upstream in the node repo for fs.lstatSync.

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

1 participant