package core:path/filepath
Overview
Process paths using either forward slashes or backslashes depending on the operating system. To process paths such as URLs that depend on forward slashes regardless of the OS, use the slashpath package.
Index
Types (2)
Constants (4)
Variables (1)
Procedure Groups (2)
Types
Relative_Error ¶
Relative_Error :: enum int { None, Cannot_Relate, }
Related Procedures With Returns
Constants
LIST_SEPARATOR ¶
LIST_SEPARATOR :: ';'
SEPARATOR ¶
SEPARATOR :: '\\'
SEPARATOR_CHARS ¶
SEPARATOR_CHARS: string : `/\`
SEPARATOR_STRING ¶
SEPARATOR_STRING: string : `\`
Variables
replace_path_separators ¶
replace_path_separators: proc(path: string, new_sep: untyped rune, allocator: runtime.Allocator) -> (new_path: string, err: os.Error) = …
Returns the result of replacing each path separator character in the path
with the specific character new_sep.
Allocates Using Provided Allocator
Procedures
dir ¶
dir :: proc(path: string, allocator := context.allocator) -> string {…}
Returns all but the last element path, usually the path's directory. Once the final element has been removed,
dir calls clean on the path and trailing separators are removed. If the path consists purely of separators,
then "." is returned.
rel ¶
rel :: proc(base_path, target_path: string, allocator := context.allocator) -> (string, Relative_Error) {…}
Returns a relative path that is lexically equivalent to the target_path when joined with the base_path with an OS specific separator.
e.g. join(base_path, rel(base_path, target_path)) is equivalent to target_path
On failure, the Relative_Error will be state it cannot compute the necessary relative path.
Procedure Groups
walker_create ¶
walker_create :: proc{ os.walker_create_path, os.walker_create_file, }
Creates a walker, either using a path or a file pointer to a directory the walker will start at.
For an example on how to use the walker, see walker_walk.
walker_init ¶
walker_init :: proc{ os.walker_init_path, os.walker_init_file, }
Initializes a walker, either using a path or a file pointer to a directory the walker will start at.
You are allowed to repeatedly call this to reuse it for later walks.
For an example on how to use the walker, see walker_walk.
Source Files
- match.odin
- path.odin
- walk.odin
- (hidden platform specific files)
Generation Information
Generated with odin version dev-2026-02 (vendor "odin") Windows_amd64 @ 2026-02-28 21:12:57.279037200 +0000 UTC