DoxigAlpha

joinZ

Function parameters

Parameters

#
paths:[]const []const u8

Functions in this namespace

Functions

#
closeAndFree
Whether or not the handle should be closed, or the path should be freed

Source

Implementation

#
pub fn joinZ(self: Directory, allocator: Allocator, paths: []const []const u8) ![:0]u8 {
    if (self.path) |p| {
        // TODO clean way to do this with only 1 allocation
        const part2 = try fs.path.join(allocator, paths);
        defer allocator.free(part2);
        return fs.path.joinZ(allocator, &[_][]const u8{ p, part2 });
    } else {
        return fs.path.joinZ(allocator, paths);
    }
}