Documentation, add more examples (#13825)
This commit is contained in:
parent
484548c784
commit
4816984726
5 changed files with 26 additions and 12 deletions
|
|
@ -70,3 +70,13 @@ proc inotify_add_watch*(fd: cint; name: cstring; mask: uint32): cint{.
|
|||
# Remove the watch specified by WD from the inotify instance FD.
|
||||
proc inotify_rm_watch*(fd: cint; wd: cint): cint{.cdecl,
|
||||
importc: "inotify_rm_watch", header: "<sys/inotify.h>".}
|
||||
|
||||
|
||||
runnableExamples:
|
||||
when defined(linux):
|
||||
block:
|
||||
let inoty: cint = inotify_init() ## Create 1 Inotify.
|
||||
doAssert inoty >= 0 ## Check for errors.
|
||||
let watchdoge: cint = inotify_add_watch(inoty, ".", IN_ALL_EVENTS) ## Add directory to watchdog.
|
||||
doAssert watchdoge >= 0 ## Check for errors.
|
||||
doAssert inotify_rm_watch(inoty, watchdoge) >= 0 ## Remove directory from the watchdog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue