zig.guide
zig.guide copied to clipboard
Update 03.filesystem-cwd-create.zig
In the Filesystem guide https://zig.guide/standard-library/filesystem/ the first code snippet is not logically valid.
The line:
const bytes_written = try file.writeAll("Hello File!");
is not correct, because file.writeAll
has return type of WriteError!void
, so variable bytes_written
is always void
in this case.
bytes_written
can be gotten if we replace writeAll
by write
, but I don't think we want to do that in this example.