Skip to content

A data link's source file is never monitored on Windows #898

Description

@DTW-Thalion

A data link never notices that its source file changed on Windows.

NSDataLinkManager watches source files with inotify, which only Linux has.
The include of sys/inotify.h at Source/NSDataLinkManager.m:42 is guarded
on the HAVE_SYS_INOTIFY_H macro, and the watch table, -startMonitoring,
-monitorLoop and the inotify_add_watch calls sit behind the same condition
or behind an _inotifyFD that stays at -1.

Where the header is absent the manager still builds and still accepts links,
so nothing reports that monitoring is not running. The delegate is simply
never asked, and an application sees a link that never refreshes.

Tests/gui/NSDataLink/sourceMonitoring.m:98 fails on Windows for this reason
and passes on Linux. It writes to the source file and waits 5 seconds for the
delegate to be asked.

Windows has ReadDirectoryChangesW for the same purpose and macOS has kqueue,
so carrying this to either would mean a small watcher of its own behind the
manager's interface.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions