Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

setPath

Private Function
std.tar.Writer.setPath
fn setPath(w: *Writer, header: *Header, sub_path: []const u8) Error!void

Writes path in posix header, if don't fit (in name+prefix; 100+155 bytes) writes it in gnu extended header.

Params

Errors

WriteFailed
OctalOverflow
NameTooLong

File

tar/Writer.zig:135
135
136
137
138
139
140
141
142
143
144
145
146
147
fn setPath(w: *Writer, header: *Header, sub_path: []const u8) Error!void {
    header.setPath(w.prefix, sub_path) catch |err| switch (err) {
        error.NameTooLong => {
            // write extended header
            const buffers: []const []const u8 = if (w.prefix.len == 0)
                &.{sub_path}
            else
                &.{ w.prefix, "/", sub_path };
            try w.writeExtendedHeader(.gnu_long_name, buffers);
        },
        else => |e| return e,
    };
}