diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-07-20 16:25:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 16:25:36 +0200 |
commit | d744c0c6d9a557bbaa2a23571ffb3acabf19c35a (patch) | |
tree | 6f7fb8a71b786e79c48f4b2c11a5a9ca988717e8 /docs/examples/file_system_events.md | |
parent | 9b9becf1ae256b645e37a7eecf3441f3ae4b8ea5 (diff) |
chore: move docs to separate repository
Diffstat (limited to 'docs/examples/file_system_events.md')
-rw-r--r-- | docs/examples/file_system_events.md | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/docs/examples/file_system_events.md b/docs/examples/file_system_events.md deleted file mode 100644 index ba61d9284..000000000 --- a/docs/examples/file_system_events.md +++ /dev/null @@ -1,40 +0,0 @@ -# File system events - -## Concepts - -- Use [Deno.watchFs](https://doc.deno.land/builtin/stable#Deno.watchFs) to watch - for file system events. -- Results may vary between operating systems. - -## Example - -To poll for file system events in the current directory: - -```ts -/** - * watcher.ts - */ -const watcher = Deno.watchFs("."); -for await (const event of watcher) { - console.log(">>>> event", event); - // Example event: { kind: "create", paths: [ "/home/alice/deno/foo.txt" ] } -} -``` - -Run with: - -```shell -deno run --allow-read watcher.ts -``` - -Now try adding, removing and modifying files in the same directory as -`watcher.ts`. - -Note that the exact ordering of the events can vary between operating systems. -This feature uses different syscalls depending on the platform: - -- Linux: [inotify](https://man7.org/linux/man-pages/man7/inotify.7.html) -- macOS: - [FSEvents](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html) -- Windows: - [ReadDirectoryChangesW](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw) |