-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft WindowsquestionNo questions on the issue tracker, please.No questions on the issue tracker, please.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Zig Version
0.10.0-dev.3922+b98b3252b
Steps to Reproduce
On POSIX-based OS, this succeeds. On Windows, this fails.
const std = @import("std");
const assert = std.debug.assert;
pub fn main() !void {
const file = try std.fs.cwd().createFile("dummy", .{});
defer file.close();
try file.seekBy(10);
const curr_pos = try file.getPos();
assert(curr_pos == 10);
try file.pwriteAll("\xaa", 0);
assert(curr_pos == try file.getPos());
}Expected Behavior
My question is: should we strive for File.pwrite/pread (and related) to be platform-independent? My gut is telling me yes but I want to see what others think about this.
Actual Behavior
Currently, File.pwrite/pread (and related) are platform-dependent.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsMicrosoft WindowsquestionNo questions on the issue tracker, please.No questions on the issue tracker, please.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.