diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-06 21:06:30 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:08 -0800 |
| commit | 916998315967f73c91e682e9ea05dd3232818654 (patch) | |
| tree | 6cd1ee9b952441c6b6ea1ddbad17a5cfd4b5f860 /lib/std/Io/File.zig | |
| parent | 877032ec6a0007316f42658d12042f1473de4856 (diff) | |
| download | zig-916998315967f73c91e682e9ea05dd3232818654.tar.gz zig-916998315967f73c91e682e9ea05dd3232818654.zip | |
std.fs: migrate most of the API elsewhere
Diffstat (limited to 'lib/std/Io/File.zig')
| -rw-r--r-- | lib/std/Io/File.zig | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/std/Io/File.zig b/lib/std/Io/File.zig index b24c0b5100..8e71f648e2 100644 --- a/lib/std/Io/File.zig +++ b/lib/std/Io/File.zig @@ -489,22 +489,6 @@ pub const WriteFileStreamingError = error{ SystemResources, } || Io.Cancelable || Io.UnexpectedError; -/// Opens a file for reading or writing, without attempting to create a new -/// file, based on an absolute path. -/// -/// Returns an open resource to be released with `close`. -/// -/// Asserts that the path is absolute. See `Dir.openFile` for a function that -/// operates on both absolute and relative paths. -/// -/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). -/// On WASI, `absolute_path` should be encoded as valid UTF-8. -/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. -pub fn openAbsolute(io: Io, absolute_path: []const u8, flags: OpenFlags) OpenError!File { - assert(std.fs.path.isAbsolute(absolute_path)); - return Io.Dir.cwd().openFile(io, absolute_path, flags); -} - pub const SeekError = error{ Unseekable, /// The file descriptor does not hold the required rights to seek on it. @@ -579,3 +563,9 @@ pub const DowngradeLockError = Io.Cancelable || Io.UnexpectedError; pub fn downgradeLock(file: File, io: Io) LockError!void { return io.vtable.fileDowngradeLock(io.userdata, file); } + +test { + _ = Reader; + _ = Writer; + _ = Atomic; +} |
