efsw icon indicating copy to clipboard operation
efsw copied to clipboard

Cannot remove watched subdirectory under Linux

Open SineStriker opened this issue 3 years ago • 2 comments

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

EfswFileWatcher.zip .

SineStriker avatar Oct 04 '21 23:10 SineStriker

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.

SpartanJ avatar Oct 05 '21 21:10 SpartanJ

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.

SineStriker avatar Oct 06 '21 04:10 SineStriker