Replace inotify #29

Closed
opened 2026-01-28 02:48:03 +00:00 by scossu · 1 comment
Owner

The inotify interface used in pkar_watch is quite handy but has two main problems: a) it only works with Linux; and b) it doesn't seem to detect files coming from SMB clients.

The latter issue is quite annoying as it prevents Pocket Archive being used over SMB.

Alternatives can be considered:

A poll() interface, such as the one provided by LuaPosix. This is the most minimalistic cross-platform option. Slow and single-threaded, but for the job it has to do, it doesn't matter. It needs some workarounds to be able to detect new files in a given directory (if it can even work).

libev or libuv bindings. These are wrappers around several back ends that cover the full Unix spectrum. The latter is higher-level and has many more features that Pocket Archive doesn't need.

cqueues. This is also a Unix-wide wrapper, and it is very widely used. Probably much larger than necessary.

The inotify interface used in `pkar_watch` is quite handy but has two main problems: a) it only works with Linux; and b) it doesn't seem to detect files coming from SMB clients. The latter issue is quite annoying as it prevents Pocket Archive being used over SMB. Alternatives can be considered: A `poll()` interface, such as the one provided by LuaPosix. This is the most minimalistic cross-platform option. Slow and single-threaded, but for the job it has to do, it doesn't matter. It needs some workarounds to be able to detect new files in a given directory (if it can even work). libev or libuv bindings. These are wrappers around several back ends that cover the full Unix spectrum. The latter is higher-level and has many more features that Pocket Archive doesn't need. cqueues. This is also a Unix-wide wrapper, and it is very widely used. Probably much larger than necessary.
scossu added this to the v1.2.0 milestone 2026-01-28 02:48:03 +00:00
Author
Owner

The issue with smb and other remotely mounted file systems has been resolved in da1a38820d by watching the IN_CREATE event instead of IN_CLOSE_WRITE.

Linux-only support is not a problem since a docker compose setup is provided.

Closing.

The issue with smb and other remotely mounted file systems has been resolved in da1a38820d by watching the `IN_CREATE` event instead of `IN_CLOSE_WRITE`. Linux-only support is not a problem since a docker compose setup is provided. Closing.
scossu modified the milestone from v1.2.0 to v1.0.0 2026-11-09 03:45:33 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ktx/pocket_archive#29
No description provided.