Module libc/dirent

libc/dirent
Stability: unstable — a raw C binding, not a Yo design, and currently unused: nothing in the tree imports it. Directory listing does NOT go through `<dirent.h>` — `std/fs/dir` reads entries through the async runtime (`__yo_async_getdents_start` plus the `__yo_dirent_*` field accessors in `std/sys/externs.yo`), because a blocking `readdir` cannot be driven from the event loop. `DIR` and `dirent` are bound as opaque `Type`s for the same reason `sys/stat`'s `statbuf` is `*void`: their layout is per-OS. The supported surface is `std/fs/dir`. — stable modules only change additively; this one may still change.

C11 <dirent.h> — directory entry operations.

Stability

unstable — a raw C binding, not a Yo design, and currently unused: nothing in the tree imports it. Directory listing does NOT go through <dirent.h>std/fs/dir reads entries through the async runtime (__yo_async_getdents_start plus the __yo_dirent_* field accessors in std/sys/externs.yo), because a blocking readdir cannot be driven from the event loop. DIR and dirent are bound as opaque Types for the same reason sys/stat's statbuf is *void: their layout is per-OS. The supported surface is std/fs/dir.

Types

DIR type-alias
DIR
dirent type-alias
dirent

Functions

opendir function
fn(name : *(char)) -> ?(*(DIR))

Parameters

NameTypeNotes
name*(char)

Returns: ?(*(DIR))

closedir function
fn(dirp : *(DIR)) -> int

Parameters

NameTypeNotes
dirp*(DIR)

Returns: int

readdir function
fn(dirp : *(DIR)) -> ?(*(dirent))

Parameters

NameTypeNotes
dirp*(DIR)

Returns: ?(*(dirent))

rewinddir function
fn(dirp : *(DIR)) -> unit

Parameters

NameTypeNotes
dirp*(DIR)

Returns: unit

Constants

DT_UNKNOWN constant u8

Value: <unknown: u8>

DT_FIFO constant u8

Value: <unknown: u8>

DT_CHR constant u8

Value: <unknown: u8>

DT_DIR constant u8

Value: <unknown: u8>

DT_BLK constant u8

Value: <unknown: u8>

DT_REG constant u8

Value: <unknown: u8>

DT_LNK constant u8

Value: <unknown: u8>

DT_SOCK constant u8

Value: <unknown: u8>

DT_WHT constant u8

Value: <unknown: u8>