Live data from Hacker News

Show HN: Filesystem Watcher

github.com

21–30 of 80 posts

Re: Show HN: Filesystem Watcher

#22
post #13
post #9

How does this work under the covers on Linux? Is it using eBPF, or is it simply an abstraction over inotify? I'm particularly interested in something like this, but which will include information about what process made the change, and which user it was running as at the time.

>or is it simply an abstraction over inotify? Looks like it: https://github.com/e-dant/watcher/blob/989147b183ee0547d71a1...

`scan_directory` in the same file recursively iterates directories and no calls to `inotify_*` functions seem to be made; no grep matches in the project directory.

Re: Show HN: Filesystem Watcher

#24
post #15

Looks like it does exactly what you can get out of Everything ( https://www.voidtools.com ) Index Journal https://www.voidtools.com/forum/viewtopic.php?t=9792 but programmatically and its highly scriptable, pretty cool. Will definitely add it to my arsenal of troubleshooting tools. Edit: never mind, This tool is manually scanning the filesystem instead of listening to OS events https://github.com/e-dant/watcher/blob/…

For clarity, the author did say in another comment that for Windows they plan to implement system API calls to watch files instead of manually scanning the filesystem. For macOS and linux it is listening to OS events.

Re: Show HN: Filesystem Watcher

#25
post #18

Earlier quoted context omitted.

Of course it does, its competing with Microsoft by providing actually working instant local search.

My chrome browser.

> instant local search

still checks out :) But I checked just to be sure and no warning in Version 106.0.5249.91 (Official Build) (32-bit). Maybe its your corporate baby content web filter?

Re: Show HN: Filesystem Watcher

#26
post #24
post #15

Looks like it does exactly what you can get out of Everything ( https://www.voidtools.com ) Index Journal https://www.voidtools.com/forum/viewtopic.php?t=9792 but programmatically and its highly scriptable, pretty cool. Will definitely add it to my arsenal of troubleshooting tools. Edit: never mind, This tool is manually scanning the filesystem instead of listening to OS events https://github.com/e-dant/watcher/blob/…

For clarity, the author did say in another comment that for Windows they plan to implement system API calls to watch files instead of manually scanning the filesystem. For macOS and linux it is listening to OS events.

Everything uses https://en.wikipedia.org/wiki/USN_Journal for fast NTFS monitoring.

Re: Show HN: Filesystem Watcher

#27
Any reason for making delay_ms a template parameter? A compiler should be able to optimize passing a constant as a regular function argument. And if it’s not optimized I assume a variable delay wouldn’t affect much?

Re: Show HN: Filesystem Watcher

#28
post #15

Looks like it does exactly what you can get out of Everything ( https://www.voidtools.com ) Index Journal https://www.voidtools.com/forum/viewtopic.php?t=9792 but programmatically and its highly scriptable, pretty cool. Will definitely add it to my arsenal of troubleshooting tools. Edit: never mind, This tool is manually scanning the filesystem instead of listening to OS events https://github.com/e-dant/watcher/blob/…

It’s being addressed here:

https://github.com/e-dant/watcher/issues/10

Re: Show HN: Filesystem Watcher

#29
post #16

Looking at Win32, it scans the whole directory periodically, right? I must miss something, but how can that be called efficient?

Wait, it doesnt hook the OS file handling routines? it actually manually rescans the filesystem?

It does one or the other. There are concerns about OS filesystem event hooks.

The current solution isn’t ideal, and is being addressed here: https://github.com/e-dant/watcher/issues/10

Re: Show HN: Filesystem Watcher

#30
post #11

Does it keep working when files get overwritten by moving another over it, like some Linux text editors do?

I should test this. I haven’t seen a problem with that so far in my personal usage, so I’m inclined to say probably.

That’s a good test case. I’ll make an issue.

Post reply on HN