aionotify icon indicating copy to clipboard operation
aionotify copied to clipboard

Allow watching a file that didn't exist before

Open davidthomaswood opened this issue 5 years ago • 6 comments

If a watch request fails because the file didn't exist, an OSError is correctly raised, but the alias remains in the list of requests. Therefore it isn't possible to catch the exception, and retry the watch request once the file has been created.

This patch adds the watch request to the request queue after attempting to call _setup_watch, to ensure it doesn't get left in the queue if the setup fails.

davidthomaswood avatar Apr 08 '19 17:04 davidthomaswood

I think the same should be done in the unwatch() method. If a watched file is removed, it's not possible to unwatch it because the kernel will raise an OSError. In that case, the request is left around and you can't watch() the file again later.

albertodonato avatar Dec 06 '19 17:12 albertodonato

What I described seems to be a similar issue to the one mentioned in https://github.com/rbarrois/aionotify/issues/2

albertodonato avatar Dec 06 '19 17:12 albertodonato

@rbarrois hi, any chance this could be merged?

albertodonato avatar Feb 10 '20 07:02 albertodonato

Any updates?

spumer avatar Mar 26 '20 14:03 spumer

Is this project dead? no action for years.

fpemud avatar Nov 25 '20 09:11 fpemud

I copy original module and apply all PR changes for my copy. All works fine, but this really sad when i see no progress all this time

spumer avatar Nov 25 '20 11:11 spumer