std.Io.File.Atomic
- Kind
- struct
- Module
std.Io.File
Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
The entries of std.Io.File in the Zig reference. This page has 72 cards.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn close(file: File, io: Io) void
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn closeMany(io: Io, files: []const File) void
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn createMemoryMap(file: File, io: Io, options: MemoryMap.CreateOptions) MemoryMap.CreateError!MemoryMap
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn downgradeLock(file: File, io: Io) LockError!void
Assumes the file is already locked in exclusive mode.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn enableAnsiEscapeCodes(file: File, io: Io) EnableAnsiEscapeCodesError!void
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn hardLink(file: File, io: Io, new_dir: Dir, new_sub_path: []const u8, options: HardLinkOptions) HardLinkError!void
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn isTty(file: File, io: Io) Io.Cancelable!bool
Test whether the file refers to a terminal (similar to libc "isatty").
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn length(file: File, io: Io) LengthError!u64
Retrieve the ending byte index of the file.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn lock(file: File, io: Io, l: Lock) LockError!void
Blocks when an incompatible lock is held by another process.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
Memory intended to remain consistent with file contents.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
Concurrently read from multiple file streams, eliminating risk of deadlocking.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
Cross-platform representation of permissions on a file.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn reader(file: File, io: Io, buffer: []u8) Reader
Defaults to positional reading; falls back to streaming.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn readerStreaming(file: File, io: Io, buffer: []u8) Reader
Positional is more threadsafe, since the global seek position is not affected, but when such syscalls are not available, preemptively initializing in streaming mode skips a failed syscall.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn readPositional(file: File, io: Io, buffer: []const []u8, offset: u64) ReadPositionalError!usize
Returns 0 on stream end or if `buffer` has no space available for data.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn readPositionalAll(file: File, io: Io, buffer: []u8, offset: u64) ReadPositionalError!usize
Equivalent to creating a positional reader and reading multiple times to fill `buffer`.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn readStreaming(file: File, io: Io, buffer: []const []u8) ReadStreamingError!usize
May return fewer bytes than buffer space available, including 0.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn realPath(file: File, io: Io, out_buffer: []u8) RealPathError!usize
Obtains the canonicalized absolute path name corresponding to an open file handle.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn setLength(file: File, io: Io, new_length: u64) SetLengthError!void
Truncates or expands the file, populating any new data with zeroes.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn setOwner(file: File, io: Io, owner: ?Uid, group: ?Gid) SetOwnerError!void
Also known as "chown". The process must have the correct privileges in order to do this successfully.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn setPermissions(file: File, io: Io, new_permissions: Permissions) SetPermissionsError!void
Also known as "chmod". The process must have the correct privileges in order to do this successfully, or must have the effective user ID matching the owner of the file.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn init(optional: ?Io.Timestamp) SetTimestamp
Convenience for interacting with `Stat`, in which `null` indicates `unchanged`.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn setTimestamps(file: File, io: Io, options: SetTimestampsOptions) SetTimestampsError!void
The granularity that ultimately is stored depends on the combination of operating system and file system.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn setTimestampsNow(file: File, io: Io) SetTimestampsError!void
Sets the accessed and modification timestamps of `file` to the current wall clock time.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn stat(file: File, io: Io) StatError!Stat
Returns `Stat` containing basic information about the `File`.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn stderr() File
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn stdin() File
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn stdout() File
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn supportsAnsiEscapeCodes(file: File, io: Io) Io.Cancelable!bool
Test whether ANSI escape codes will be treated as such without attempting to enable support for ANSI escape codes.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn sync(file: File, io: Io) SyncError!void
Blocks until all pending file contents and metadata modifications for the file have been synchronized with the underlying filesystem.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn tryLock(file: File, io: Io, l: Lock) LockError!bool
Attempts to obtain a lock, returning `true` if the lock is obtained, and `false` if there was an existing incompatible lock held.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn unlock(file: File, io: Io) void
Assumes the file is locked.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writePositional(file: File, io: Io, buffer: []const []const u8, offset: u64) WritePositionalError!usize
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writePositionalAll(file: File, io: Io, bytes: []const u8, offset: u64) WritePositionalError!void
Equivalent to creating a positional writer, writing `bytes`, and then flushing.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writer(file: File, io: Io, buffer: []u8) Writer
Defaults to positional reading; falls back to streaming.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writerStreaming(file: File, io: Io, buffer: []u8) Writer
Positional is more threadsafe, since the global seek position is not affected, but when such syscalls are not available, preemptively initializing in streaming mode will skip a failed syscall.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writeStreaming(file: File, io: Io, header: []const u8, data: []const []const u8, splat: usize) Writer.Error!usize
This is a low-level API that calls the `Io` interface function directly.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn writeStreamingAll(file: File, io: Io, bytes: []const u8) Writer.Error!void
Equivalent to creating a streaming writer, writing `bytes`, and then flushing.
std.Io.FileSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.