Path¶
Import: import system.io;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Path¶
Path helpers for joining and inspecting filesystem paths.
join¶
Joins path segments with the platform separator, skipping empty segments and avoiding duplicate separators. Supply additional segments as trailing arguments.
file_name¶
Final path component after the last / or \, or None for a trailing separator.
extension¶
Substring after the last . in the file name, or None when missing.
parent¶
Directory portion of path, or None when there is no separator.
is_absolute¶
True for POSIX absolute paths (/…), Windows drive paths (C:…), or \-rooted paths.
normalize¶
Resolves . and .. segments where possible. Does not consult the filesystem.
separator¶
Host path separator. Always / in the WASM stdlib surface (native hosts accept / even on Windows); use OsFamily at call sites when Windows-style paths are required.
stem¶
File name without the last extension ("a.tar.gz" → "a.tar").
with_extension¶
Replaces the last extension, or appends ext when the path has none. ext may include a leading ..
with_file_name¶
Replaces the final path component with name.
has_extension¶
True when the last extension equals ext (with or without a leading .).
components¶
Splits path on / and \, skipping empty segments.
absolute¶
Joins path onto the process cwd when it is relative, then normalizes. Does not consult realpath.
relative_to¶
String-prefix relative path after normalize (not realpath). None when path is not under base.