efsw
efsw copied to clipboard
Cannot remove watched subdirectory under Linux
Suppose a file system structure like this (Under deepin-x86_64),
|-- test1
|-- test1-1
|-- test1-1-1
|-- test1-2
|-- test2
When I add test1 and test1-1 both recursively to the watcher, then the test1-1 cannot be removed.
Generally, if a dir has been added, then once its subdir is added then the subdir can't be removed. Addition of subdir after removing will cause an error of file repeated
I understand. The real issue is that addWatch
shouldn't add the watch/directory that it's already observed by the first recursive watcher.
I never thought about it because it's kinda unintuitive and not really a correct way of using the recursive watcher. You should not use recursive watchers for that use case. I'll add a patch for this soon.
But that way of use works correctly under windows and mac. Now I set up a tree structure of absoulte path to check in advance and seemingly avoid such issue.