Programming Search⌘K

std.Io.Dir

The entries of std.Io.Dir in the Zig reference. This page has 138 cards.

std.Io.Dir.copyFile

pub fn copyFile(source_dir: Dir, source_path: []const u8, dest_dir: Dir, dest_path: []const u8, io: Io, options: CopyFileOptions) CopyFileError!void

Atomically creates a new file at `dest_path` within `dest_dir` with the same contents as `source_path` within `source_dir`.

Kind
function
Module
std.Io.Dir

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Dir.createFileAtomic

pub fn createFileAtomic(dir: Dir, io: Io, sub_path: []const u8, options: CreateFileAtomicOptions) CreateFileAtomicError!File.Atomic

Create an unnamed ephemeral file that can eventually be atomically materialized into `sub_path`. `sub_path` must be valid until the atomic file is materialized.

Kind
function
Module
std.Io.Dir

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Dir.readFileAllocOptions

pub fn readFileAllocOptions(dir: Dir, io: Io, sub_path: []const u8, gpa: Allocator, limit: Io.Limit, comptime alignment: std.mem.Alignment, comptime sentinel: ?u8) ReadFileAllocError!(if (sentinel) |s| [:s]align(alignment.toByteUnits()) u8 else []align(alignment.toByteUnits()) u8)

Reads all the bytes from the named file.

Kind
function
Module
std.Io.Dir

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Dir.setPermissions

pub fn setPermissions(dir: Dir, io: Io, new_permissions: File.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 directory.

Kind
function
Module
std.Io.Dir

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Dir.walk

pub fn walk(dir: Dir, allocator: Allocator) Allocator.Error!Walker

Recursively iterates over a directory. `dir` must have been opened with `OpenOptions.iterate` set to `true`. `Walker.deinit` releases allocated memory and directory handles.

Kind
function
Module
std.Io.Dir

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.