Skip to documentation
SLOP

tiny.sandbox.resolve

Reference tiny.sandbox resolve

Defined in tiny.sandbox.

API (2)

Actions

Public operations.

No direct callersNo direct callstiny.sandboxresolve
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsNo direct callscwdensureInsideresolvedirPathAllocZtest sourcelib.sandbox.src.resolvetest: dir path resolves real director...test sourcelib.sandbox.src.resolvetest: dir path resolves the current w...resolvedirPath
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsprivate sourcelib.sandbox.src.bwraprealPathAllocresolvedirPathresolvedirPathAllocZ
Static calls · unresolved targets: 0 · external targets: 1.

Source: lib/sandbox/src/resolve.zig

zig
const std = @import("std");const sys = @import("sys");const fs_io = sys.fs.debugIo();pub fn dirPath(dir: sys.fs.Dir, buffer: []u8) ![]const u8 {    if (dir.handle == std.Io.Dir.cwd().handle) {        const len = try std.process.currentPath(fs_io, buffer);        return buffer[0..len];    }    const len = try dir.realPath(fs_io, buffer);    return buffer[0..len];}pub fn dirPathAllocZ(allocator: std.mem.Allocator, dir: sys.fs.Dir) ![:0]u8 {    var buffer: [std.fs.max_path_bytes]u8 = undefined;    const path = try dirPath(dir, &buffer);    return try allocator.dupeSentinel(u8, path, 0);}test "dir path resolves the current working directory pseudo handle" {    var buffer: [std.fs.max_path_bytes]u8 = undefined;    const resolved = try dirPath(std.Io.Dir.cwd(), &buffer);    try std.testing.expect(std.fs.path.isAbsolute(resolved));}test "dir path resolves real directory handles" {    var tmp = std.testing.tmpDir(.{});    defer tmp.cleanup();    var buffer: [std.fs.max_path_bytes]u8 = undefined;    const resolved = try dirPath(tmp.dir, &buffer);    try std.testing.expect(std.fs.path.isAbsolute(resolved));}

Source: lib/sandbox/src/root.zig:40

zig
pub const resolve = @import("resolve.zig");

Audit

Definitions3
Public names3
Members0
Version26.7.0
Revisiondaab053ee433