This Article IsCreated at 2023-10-31Last Modified at 2024-02-17Referenced as ia.www.f08

Beware of Zig std.io

As the time of writing (latest stable Zig version is 0.11.0), Zig’s std.io is often arbitrary when handling POSIX API error.

Example 1 Example 2

Advice: use C POSIX API directly for a more robust experience.

Update: Found another Zig bug, where std.fs.Dir.readFile may return without the entire file content. As for why my issue is closed as not planned but the corresponding PR is open, this is the reason I think.