Reputation: 335
While watching folder which has subfolders using Chokidar,The watch folder cannot be renamed.
Versions: Chokidar version: 3.5.2 Angular CLI: 12.0.2 Node: 16.17.0 Package Manager: npm 9.2.0 OS version: Windows 10
//defaultOptions for chokidar :
defaultOptions = {
ignored: /(^|[\/\\])\../, // ignore dotfiles
persistent: true,
depth: 99,
alwaysStat: true,
awaitWriteFinish: {
stabilityThreshold: 2000,
pollInterval: 100
},
ignorePermissionErrors: false,
atomic: true // or a custom 'atomicity delay', in milliseconds (default 100)
}
Step 1 : Watch any folder, say Test 1 using chokidar.
Step 2 : Created another folder inside Test 1 say Test 2
Step 3 : Trying renaming Test 2
Step 4 : You should see a Windows prompt "Folder in use" and "The action can't be completed because the folder or file in it is open in another application.
we have observed below thing as well, we thing root cause would be the same that would folder permissions or folder in use.
NOTE : Similarly if the sub-folder is non empty ,User is not allowed to delete it and User get prompt "Folder Access Denied" and You'll need to provide administrator permission to delete this folder.
we found some useful links in chokidar forum on Github, below are the links.
https://github.com/Bistard/nota/issues/149
https://github.com/hoperyy/sync-directory/issues/53
https://github.com/paulmillr/chokidar/issues/664
Upvotes: 6
Views: 248