WebFreak001 / FSWatch

A cross-platform folder & file watching library using win32, inotify or std.file
33 stars 8 forks source link

Support for subdirectories in inotify version #11

Closed FraMecca closed 6 years ago

FraMecca commented 6 years ago

Hi, I have noticed that FSWatch when using inotify provides no support for watching subdirectories and files within subdirectories.

I have added support for watching subdirectories and files within, Also, I have added tests for subdirectories creation, file modification and removal

FraMecca commented 6 years ago

I have updated the code and commented on some of your suggestions above.

WebFreak001 commented 6 years ago

Thanks! I'm not sure yet about having the whole thing as static array, especially in fibers/threads with small stack or with more than 4k subdirectories, a not preallocated GC array (maybe call reserve in the constructor, but making it with length complicates the implementation) FDInfo[] would be better I think, sorry if I was a bit imprecise there. Also is there still a reason why you only check for ev.type and not for ev.path in some of the unittests?

FraMecca commented 6 years ago

I have updated the test suite and now also the path is tested. I also tested that removeSelf is returned only when the watched folder is removed and that the path of the event is "." because relative

FraMecca commented 6 years ago

I also noticed that the previous travisCL build failed for some timeout error