Stat:ready() -> StatWait until this operation completes, then return the same handle for chaining. Raises if the operation failed. A completed handle returns at once.
In the guide: Open, pick and save files
handle2 methods, 4 fields
In-flight file or directory metadata from file:stat / dir:stat. Payload fields raise until it is ready — await :ready() or datumhue.ready, or probe state.
| Field | Type | Access | Description |
|---|---|---|---|
state | ReadyState | read-only | Completion state of this operation. Reading it never raises or suspends; a failed operation's error surfaces at :ready(). |
kind | Dir.EntryKind | read-only | Whether the entry is a file or a directory. |
size | integer | read-only | Size in bytes. |
mtime | integer? | read-only | Modification time in Unix seconds; nil where the file's storage does not record one. |
Stat:ready() -> StatWait until this operation completes, then return the same handle for chaining. Raises if the operation failed. A completed handle returns at once.
In the guide: Open, pick and save files
Stat:on_done(callback?: fun(handle: Stat))Set, replace, or clear (pass nil) the callback run once, as a callback of its own, when this operation leaves pending. On a handle that has already left it, the callback runs after the current callback returns, never during this call. A set callback keeps the operation's outcome alive, even with no other reference to the handle, and keeps the app running until it runs or is cleared.