Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Latest commit

 

History

History
14 lines (8 loc) · 1.26 KB

windows.md

File metadata and controls

14 lines (8 loc) · 1.26 KB

Windows

On Windows, @atom/watcher uses the ReadDirectoryChangesW() call to monitor a directory for changes. ReadDirectoryChangesW is called in asynchronous mode with a completion routine. Out-of-band command signalling is handled by an asynchronous procedure call scheduled with QueueUserAPC().

ReadDirectoryChangesW oddities

The FILE_NOTIFY_INFORMATION structure provided to the completion routine does not indicate whether the entry is a directory or a file. @atom/watcher uses GetFileAttributesW to identify entry kinds, but leaves them as "unknown" for deletions.

If the filesystem does not support events and ERROR_INVALID_FUNCTION is returned, @atom/watcher will fall back to polling. However, depending on the filesystem, Windows may simply fail to deliver events.

Known platform limits

A Windows process can open a maximum of 16,711,680 handles, so the number of watch roots is somewhat less than that 😉