const std = @import("std"); pub fn main() !void { const name = "myfile.txt"; var buffer: [100]u8 = undefined; const f = std.fs.cwd().openFile(name, .{}); // https://ziglang.org/documentation/0.12.0/std/#std.fs.cwd std.debug.print("Type de f : {any}\n", .{@TypeOf(f)}); const fo = try std.fs.cwd().openFile(name, .{}); std.debug.print("Type de fo: {any}\n", .{@TypeOf(fo)}); std.debug.print("File opened? {any}\n", .{fo}); const result = try fo.readAll(&buffer); // https://ziglang.org/documentation/0.12.0/std/#std.net.Stream.readAll std.debug.print("Result of read is {d} and content is \"{s}\"\n", .{ result, buffer[0..result] }); }