Function join [src]
Prototype
pub fn join(p: Path, arena: Allocator, sub_path: []const u8) Allocator.Error!Path
Parameters
p: Path
arena: Allocator
sub_path: []const u8
Source
pub fn join(p: Path, arena: Allocator, sub_path: []const u8) Allocator.Error!Path {
if (sub_path.len == 0) return p;
const parts: []const []const u8 =
if (p.sub_path.len == 0) &.{sub_path} else &.{ p.sub_path, sub_path };
return .{
.root_dir = p.root_dir,
.sub_path = try fs.path.join(arena, parts),
};
}