| author | |
| committer | |
| log | 83a2665772578f6262afc858613023738a7d25ef |
| tree | 73fa61dcd465d7d4f61f50881d2241f398a4f665 |
| parent | 7302b096bd6e4274080eab051f6f3e1ab49213b9 |
2 files changed, 5 insertions(+), 6 deletions(-)
lib/std/fs/file.zig+4-4| ... | @@ -223,15 +223,15 @@ pub const File = struct { | ... | @@ -223,15 +223,15 @@ pub const File = struct { |
| 223 | return os.lseek_SET(self.handle, offset); | 223 | return os.lseek_SET(self.handle, offset); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | pub const GetPosError = os.SeekError || os.FStatError; | 226 | pub const GetSeekPosError = os.SeekError || os.FStatError; |
| 227 | 227 | ||
| 228 | /// TODO: integrate with async I/O | 228 | /// TODO: integrate with async I/O |
| 229 | pub fn getPos(self: File) GetPosError!u64 { | 229 | pub fn getPos(self: File) GetSeekPosError!u64 { |
| 230 | return os.lseek_CUR_get(self.handle); | 230 | return os.lseek_CUR_get(self.handle); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | /// TODO: integrate with async I/O | 233 | /// TODO: integrate with async I/O |
| 234 | pub fn getEndPos(self: File) GetPosError!u64 { | 234 | pub fn getEndPos(self: File) GetSeekPosError!u64 { |
| 235 | if (builtin.os.tag == .windows) { | 235 | if (builtin.os.tag == .windows) { |
| 236 | return windows.GetFileSizeEx(self.handle); | 236 | return windows.GetFileSizeEx(self.handle); |
| 237 | } | 237 | } |
| ... | @@ -819,7 +819,7 @@ pub const File = struct { | ... | @@ -819,7 +819,7 @@ pub const File = struct { |
| 819 | pub const SeekableStream = io.SeekableStream( | 819 | pub const SeekableStream = io.SeekableStream( |
| 820 | File, | 820 | File, |
| 821 | SeekError, | 821 | SeekError, |
| 822 | GetPosError, | 822 | GetSeekPosError, |
| 823 | seekTo, | 823 | seekTo, |
| 824 | seekBy, | 824 | seekBy, |
| 825 | getPos, | 825 | getPos, |
lib/std/io/stream_source.zig+1-2| ... | @@ -5,7 +5,6 @@ | ... | @@ -5,7 +5,6 @@ |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| 6 | const std = @import("../std.zig"); | 6 | const std = @import("../std.zig"); |
| 7 | const io = std.io; | 7 | const io = std.io; |
| 8 | const testing = std.testing; | ||
| 9 | 8 | ||
| 10 | /// Provides `io.Reader`, `io.Writer`, and `io.SeekableStream` for in-memory buffers as | 9 | /// Provides `io.Reader`, `io.Writer`, and `io.SeekableStream` for in-memory buffers as |
| 11 | /// well as files. | 10 | /// well as files. |
| ... | @@ -19,7 +18,7 @@ pub const StreamSource = union(enum) { | ... | @@ -19,7 +18,7 @@ pub const StreamSource = union(enum) { |
| 19 | pub const ReadError = std.fs.File.ReadError; | 18 | pub const ReadError = std.fs.File.ReadError; |
| 20 | pub const WriteError = std.fs.File.WriteError; | 19 | pub const WriteError = std.fs.File.WriteError; |
| 21 | pub const SeekError = std.fs.File.SeekError; | 20 | pub const SeekError = std.fs.File.SeekError; |
| 22 | pub const GetSeekPosError = std.fs.File.GetPosError; | 21 | pub const GetSeekPosError = std.fs.File.GetSeekPosError; |
| 23 | 22 | ||
| 24 | pub const Reader = io.Reader(*StreamSource, ReadError, read); | 23 | pub const Reader = io.Reader(*StreamSource, ReadError, read); |
| 25 | pub const Writer = io.Writer(*StreamSource, WriteError, write); | 24 | pub const Writer = io.Writer(*StreamSource, WriteError, write); |