# fs/watch
Watch a file or directory (recursive) for changes.
## Syntax
[fs/watch $path $callback]
## Parameters
- `$path` — file or directory to watch (string)
- `$callback` — `{|flag file| ...}`; `flag` is `:created`, `:modified`, or `:removed`; `file` is the changed path
## Examples
[fs/watch "src/" {|flag file| echo $flag $file }] def wid [fs/watch "config.edn" {|flag file| if ($flag == :modified) { echo "reloading" $file } }]
## Returns
`%Ok` wrapping a numeric watch-id for use with `fs/unwatch`; `%Err` on failure.
## See Also
`fs/unwatch`, `http/serve`