Commit graph

10 commits

Author SHA1 Message Date
Timothy Flynn e25681203e LibCore: Add support for monitoring symbolic links
Symbolic links are currently always followed to their target. This lets
us monitor the link file itself.
2024-08-25 09:47:42 +02:00
Timothy Flynn 9f496a9c65 LibCore: Improve support for the macOS file watcher with actual files
When asked to monitor a file (not a directory), we often need to instead
monitor the parent directory to receive FS events. For example, when a
symbolic link is deleted/created, we don't receive any events unless we
are watching the parent.
2024-08-25 09:47:42 +02:00
Andrew Kaster 0c9dced888 Meta: Remove trivially unused Kernel API headers 2024-06-07 09:44:41 +02:00
Andreas Kling 1cb5385a29 LibCore: Stop obsessing about tiny OOMs in Core::Timer
Work towards #20405
2024-04-17 07:16:52 +02:00
Andreas Kling 12c73915dc Tests: Re-enable TestLibCoreFileWatcher on macOS
Now that cross-thread event posting is unbroken, this should work.
2023-04-26 19:17:04 +01:00
Andreas Kling cead039e7e Tests: Disable TestLibCoreFileWatcher on macOS temporarily
This broke somehow with the new event loop architecture and will need
debugging, but let's bring the CI back to green first.
2023-04-26 06:34:05 +02:00
Timothy Flynn 8438c509e9 LibCore: Make the FileWatcher test resilient against outside events
The test currently watches /tmp, which the OS can create/modify files
under at any time outside of our control. So just ignore events that we
aren't interested in.

Also test removing an item from the FileWatcher.
2023-01-19 11:29:48 +00:00
Timothy Flynn 8ca528217c LibCore: Implement FileWatcher for Linux
This implements FileWatcher using inotify filesystem events. Serenity's
InodeWatcher is remarkably similar to inotify, so this is almost an
identical implementation.

The existing TestLibCoreFileWatcher test is added to Lagom (currently
just for Linux).

This does not implement BlockingFileWatcher as that is currently not
used anywhere but on Serenity.
2023-01-18 06:46:12 -05:00
Sam Atkins a8cf0c9371 LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOr
clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
2023-01-12 11:25:51 +01:00
sin-ack 60eb4adac2 Tests: Add InodeWatcher and FileWatcher tests
This patch adds some rudimentary tests for InodeWatcher.  It tests the
basic functionality, but maybe there are corner cases I haven't caught.
Additionally, this is our first LibCore test. :^)
2021-05-12 22:38:20 +02:00