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

Deep folders can not be renamed while Gaze is watching #249

Open
kireerik opened this issue Jun 11, 2018 · 13 comments
Open

Deep folders can not be renamed while Gaze is watching #249

kireerik opened this issue Jun 11, 2018 · 13 comments
Assignees

Comments

@kireerik
Copy link

kireerik commented Jun 11, 2018

Minimal directory structure:

  • watchedFolder
    • subFolder <- can not rename while Gaze watching
      • subSubFolder <- can rename with error
        • aFile.extension
@shama
Copy link
Owner

shama commented Jun 11, 2018

I can rename folders while gaze is watching.

@shama shama closed this as completed Jun 11, 2018
@kireerik
Copy link
Author

Can you do it under Windows?

@shama
Copy link
Owner

shama commented Jun 11, 2018

@kireerik We could probably save a lot of time if you post repro steps and more information about your environment and issue you are running into.

@kireerik kireerik changed the title Folders can not be renamed while Gaze is watching Folders can not be renamed while Gaze is watching under Windows Jun 11, 2018
@kireerik
Copy link
Author

This is the minimal code where the issue is reproducible:

const {Gaze} = require('gaze')

new Gaze('watchedDirectory' + '/**')

If I try to edit a folder name within a watched folder for example using Windows' file manager then I am getting an error prompt like this:

"The action can't be completed because the folder or a file in it is open in another program"

So it can not be renamed while Gaze is watching.

@shama
Copy link
Owner

shama commented Jun 11, 2018

Windows version? Node.js version? Are you watching files from a vagrant things or shared folder or dropbox, etc

Also gaze watches file patterns, so instead of doing new Gaze('watchedDirectory' + '/**'), the 'watchedDirectory' probably isnt a file pattern. So do new Gaze('**', { cwd: 'watcheDir' }) instead.

@kireerik
Copy link
Author

Windows 10 Pro 1083 Node.js 10.4.0 No it is a simple folder.

I see. new Gaze('**', { cwd: 'watcheDir' }) doesn't makes any difference.

@shama
Copy link
Owner

shama commented Jun 11, 2018

Nothing else running that could be holding those files?

FWIW, we have tests that rename files gaze is watching that passes on Windows and this is the first Ive heard of this issue.

@kireerik
Copy link
Author

kireerik commented Jun 11, 2018

No, nothing else. As soon as I stop Gaze I can rename a folder.

As I can see the linked test is for renaming a file and not a folder.

I think Gaze is probably watching all files through watching the sub folders recursively or something like that.
I can't modify the watched folder's name either, which makes sense and it seems to me that the sub folders are working just the same way.

@kireerik
Copy link
Author

kireerik commented Jun 11, 2018

Renaming an empty folder works mostly, but for the 2. renaming I get the following error:

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, watch 'site\folder\'
    at FSWatcher.start (fs.js:1409:26)
    at Object.fs.watch (fs.js:1446:11)
    at Gaze._watchDir (node_modules\gaze\lib\gaze.js:314:30)
    at node_modules\gaze\lib\gaze.js:387:10
    at iterate (node_modules\gaze\lib\helper.js:69:5)
    at node_modules\gaze\lib\helper.js:78:11
    at node_modules\gaze\lib\gaze.js:452:5
    at iterate (node_modules\gaze\lib\helper.js:69:5)
    at node_modules\gaze\lib\helper.js:78:11
    at node_modules\gaze\lib\gaze.js:452:5
Emitted 'error' event at:
    at Gaze.emit (node_modules\gaze\lib\gaze.js:102:32)
    at Gaze._handleError (node_modules\gaze\lib\gaze.js:468:15)
    at Gaze._watchDir (node_modules\gaze\lib\gaze.js:331:17)
    at node_modules\gaze\lib\gaze.js:387:10
    [... lines matching original stack trace ...]
    at node_modules\gaze\lib\gaze.js:452:5
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

folderCurrent was renamed to folder which was renamed to folderNext. Watched directory is site.

A non empty folder gives the above error as well, but right away with the 1. renaming.

Adding an empty folder within the folder makes no difference, but once I add a file to the newly added folder the initially described issue occurs with the error prompt and the folder name can not be modified.

@kireerik kireerik changed the title Folders can not be renamed while Gaze is watching under Windows Deep folders can not be renamed while Gaze is watching Jun 11, 2018
@kireerik
Copy link
Author

I think we should keep this issue opened, since it is well defined by now and it is also consistently reproducible.

@shama
Copy link
Owner

shama commented Jun 20, 2018

Sure I'll reopen and assign to you. I cannot repro.

@shama shama reopened this Jun 20, 2018
@kireerik
Copy link
Author

All right, thank you!

May I ask you on which system can you not reproduce this?

(This might helps you to reproduce, if it is an issue on your system as well: #249 (comment))

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

3 participants