Markdown code blocks migration part 7 (#20547)
This commit is contained in:
parent
13b3ea71da
commit
19ff746916
17 changed files with 426 additions and 411 deletions
|
|
@ -75,11 +75,11 @@ proc inotify_rm_watch*(fd: cint; wd: cint): cint {.cdecl,
|
|||
|
||||
iterator inotify_events*(evs: pointer, n: int): ptr InotifyEvent =
|
||||
## Abstract the packed buffer interface to yield event object pointers.
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## ```Nim
|
||||
## var evs = newSeq[byte](8192) # Already did inotify_init+add_watch
|
||||
## while (let n = read(fd, evs[0].addr, 8192); n) > 0: # read forever
|
||||
## for e in inotify_events(evs[0].addr, n): echo e[].len # echo name lens
|
||||
## ```
|
||||
var ev: ptr InotifyEvent = cast[ptr InotifyEvent](evs)
|
||||
var n = n
|
||||
while n > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue