Module sys/file
Async and sync file operations.
Provides low-level file I/O wrappers around the C runtime externs.
Async operations return IoFuture which resolves to:
- Positive value: success (fd for open, bytes for read/write, 0 for others)
- Negative value: -errno on failure
Stability
unstable — a raw wrapper over the C file calls whose async results are a
bare i32 that is a value on success and -errno on failure, which a
caller converts with IoError.from_result. std/fs is the typed face
(File, read_to_string, write, the Reader/Writer impls) and is
what should be imported.
It freezes, if ever, as an implementation detail of std/fs. The one
thing worth knowing before then is that the *u8 + length parameter shape
here is the same one std/io's traits carry, for the same reason — Yo has
no slice type — so if a slice type arrives, both layers change together.
Functions
Parameters
| Name | Type | Notes |
|---|---|---|
dirfd | i32 | |
path | *u8 | |
flags | i32 | |
mode | i32 |
Returns: IoFuture
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 | |
buffer | *u8 | |
size | u32 | |
offset | u64 |
Returns: IoFuture
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 | |
buffer | *u8 | |
size | u32 | |
offset | u64 |
Returns: IoFuture
Parameters
| Name | Type | Notes |
|---|---|---|
dirfd | i32 | |
path | *u8 | |
flags | i32 | |
mask | u32 | |
statxbuf | *u8 |
Returns: IoFuture
Parameters
| Name | Type | Notes |
|---|---|---|
path | *u8 | |
flags | i32 | |
mode | i32 |
Returns: i32
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 |
Returns: unit
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 | |
buf | *u8 | |
count | u32 | |
offset | u64 |
Returns: i32
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 |
Returns: i64
Parameters
| Name | Type | Notes |
|---|---|---|
fd | i32 | |
statxbuf | *u8 |
Returns: i32