0 bytes reading file with readFileAlloc() but not with readSliceShort()?
Ziggit
0 bytes reading file with readFileAlloc() but not with readSliceShort()?
This seems silly, I must be overlooking something obvious. I’m trying to read the entire contents of /proc/version into a buffer. Saw std.Io.Dir.readFileAlloc() looked simple enough, but I keep getting 0 bytes back. No error, just an empty buffer. If I attempt the same thing with a more verbose std.Io.Dir.readSliceShort(), it works just fine. Here’s two test cases. test "WORKS - read /proc/version with readSliceShort()" { const proc_dir = try Io.Dir.openDirAbsolute(testing.io, "/proc", .{ ...
0 comments
No comments yet.