aiofiles icon indicating copy to clipboard operation
aiofiles copied to clipboard

file watch support?

Open samuelcolvin opened this issue 8 years ago • 2 comments

While answering https://github.com/aio-libs/aiohttp-devtools/issues/118 I suddenly wondered if aiofiles had support for watching for file changes.

It seems it doesn't at the moment, is it something you'd consider in the future?

Like watchdog it could start by implementing a brute force "iterate over files looking for changes" interface then go on to use inotify in the future (and equivalent for other OSs).

samuelcolvin avatar Aug 02 '17 18:08 samuelcolvin

My tailsocket project actually (ab)uses vanilla asyncio.add_reader which works fine on kqueue compatible platforms, on Linux though I used pyinotify which has asyncio support and seems to work well.

I haven't tested this thoroughly though.

yeraydiazdiaz avatar Aug 03 '17 08:08 yeraydiazdiaz

The problem is that aiohttp-devtools should support windows and osx so AFAIK pyinotify is out of the running.

However watchdog seems slightly buggy and does strange things with threads which is causing problems.

samuelcolvin avatar Aug 03 '17 09:08 samuelcolvin