| ... | ... | @@ -990,6 +990,8 @@ pub const File = struct { |
| 990 | 990 | return index; |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | /// On Windows, this function currently does alter the file pointer. |
| 994 | /// https://github.com/ziglang/zig/issues/12783 |
| 993 | 995 | pub fn pread(self: File, buffer: []u8, offset: u64) PReadError!usize { |
| 994 | 996 | if (is_windows) { |
| 995 | 997 | return windows.ReadFile(self.handle, buffer, offset, self.intended_io_mode); |
| ... | ... | @@ -1004,6 +1006,8 @@ pub const File = struct { |
| 1004 | 1006 | |
| 1005 | 1007 | /// Returns the number of bytes read. If the number read is smaller than `buffer.len`, it |
| 1006 | 1008 | /// means the file reached the end. Reaching the end of a file is not an error condition. |
| 1009 | /// On Windows, this function currently does alter the file pointer. |
| 1010 | /// https://github.com/ziglang/zig/issues/12783 |
| 1007 | 1011 | pub fn preadAll(self: File, buffer: []u8, offset: u64) PReadError!usize { |
| 1008 | 1012 | var index: usize = 0; |
| 1009 | 1013 | while (index != buffer.len) { |
| ... | ... | @@ -1058,6 +1062,8 @@ pub const File = struct { |
| 1058 | 1062 | } |
| 1059 | 1063 | |
| 1060 | 1064 | /// See https://github.com/ziglang/zig/issues/7699 |
| 1065 | /// On Windows, this function currently does alter the file pointer. |
| 1066 | /// https://github.com/ziglang/zig/issues/12783 |
| 1061 | 1067 | pub fn preadv(self: File, iovecs: []const os.iovec, offset: u64) PReadError!usize { |
| 1062 | 1068 | if (is_windows) { |
| 1063 | 1069 | // TODO improve this to use ReadFileScatter |
| ... | ... | @@ -1079,6 +1085,8 @@ pub const File = struct { |
| 1079 | 1085 | /// The `iovecs` parameter is mutable because this function needs to mutate the fields in |
| 1080 | 1086 | /// order to handle partial reads from the underlying OS layer. |
| 1081 | 1087 | /// See https://github.com/ziglang/zig/issues/7699 |
| 1088 | /// On Windows, this function currently does alter the file pointer. |
| 1089 | /// https://github.com/ziglang/zig/issues/12783 |
| 1082 | 1090 | pub fn preadvAll(self: File, iovecs: []os.iovec, offset: u64) PReadError!usize { |
| 1083 | 1091 | if (iovecs.len == 0) return 0; |
| 1084 | 1092 | |
| ... | ... | @@ -1122,6 +1130,8 @@ pub const File = struct { |
| 1122 | 1130 | } |
| 1123 | 1131 | } |
| 1124 | 1132 | |
| 1133 | /// On Windows, this function currently does alter the file pointer. |
| 1134 | /// https://github.com/ziglang/zig/issues/12783 |
| 1125 | 1135 | pub fn pwrite(self: File, bytes: []const u8, offset: u64) PWriteError!usize { |
| 1126 | 1136 | if (is_windows) { |
| 1127 | 1137 | return windows.WriteFile(self.handle, bytes, offset, self.intended_io_mode); |
| ... | ... | @@ -1134,6 +1144,8 @@ pub const File = struct { |
| 1134 | 1144 | } |
| 1135 | 1145 | } |
| 1136 | 1146 | |
| 1147 | /// On Windows, this function currently does alter the file pointer. |
| 1148 | /// https://github.com/ziglang/zig/issues/12783 |
| 1137 | 1149 | pub fn pwriteAll(self: File, bytes: []const u8, offset: u64) PWriteError!void { |
| 1138 | 1150 | var index: usize = 0; |
| 1139 | 1151 | while (index < bytes.len) { |
| ... | ... | @@ -1179,6 +1191,8 @@ pub const File = struct { |
| 1179 | 1191 | } |
| 1180 | 1192 | |
| 1181 | 1193 | /// See https://github.com/ziglang/zig/issues/7699 |
| 1194 | /// On Windows, this function currently does alter the file pointer. |
| 1195 | /// https://github.com/ziglang/zig/issues/12783 |
| 1182 | 1196 | pub fn pwritev(self: File, iovecs: []os.iovec_const, offset: u64) PWriteError!usize { |
| 1183 | 1197 | if (is_windows) { |
| 1184 | 1198 | // TODO improve this to use WriteFileScatter |
| ... | ... | @@ -1197,6 +1211,8 @@ pub const File = struct { |
| 1197 | 1211 | /// The `iovecs` parameter is mutable because this function needs to mutate the fields in |
| 1198 | 1212 | /// order to handle partial writes from the underlying OS layer. |
| 1199 | 1213 | /// See https://github.com/ziglang/zig/issues/7699 |
| 1214 | /// On Windows, this function currently does alter the file pointer. |
| 1215 | /// https://github.com/ziglang/zig/issues/12783 |
| 1200 | 1216 | pub fn pwritevAll(self: File, iovecs: []os.iovec_const, offset: u64) PWriteError!void { |
| 1201 | 1217 | if (iovecs.len == 0) return; |
| 1202 | 1218 | |