aboutsummaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-03-20 14:48:39 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-03-20 18:36:26 -0400
commitd1d86234aa82eeab898a926e20c47cb0f5935c7e (patch)
tree834118f78ef4f498174b6ab37293f7f6c8ed7b52 /core/os
parenta495cd581c268b96ad9034c4569293de1f9e3156 (diff)
Add missing documentation to `os2/path`
Diffstat (limited to 'core/os')
-rw-r--r--core/os/os2/path.odin39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/os/os2/path.odin b/core/os/os2/path.odin
index 7d177a85d..3dedc2961 100644
--- a/core/os/os2/path.odin
+++ b/core/os/os2/path.odin
@@ -10,6 +10,10 @@ Path_List_Separator :: _Path_List_Separator // OS-Specific
#assert(_Path_Separator <= rune(0x7F), "The system-specific path separator rune is expected to be within the 7-bit ASCII character set.")
+/*
+Return true if `c` is a character used to separate paths into directory and
+file hierarchies on the current system.
+*/
@(require_results)
is_path_separator :: proc(c: byte) -> bool {
return _is_path_separator(c)
@@ -17,22 +21,42 @@ is_path_separator :: proc(c: byte) -> bool {
mkdir :: make_directory
+/*
+Make a new directory.
+
+If `path` is relative, it will be relative to the process's current working directory.
+*/
make_directory :: proc(name: string, perm: int = 0o755) -> Error {
return _mkdir(name, perm)
}
mkdir_all :: make_directory_all
+/*
+Make a new directory, creating new intervening directories when needed.
+
+If `path` is relative, it will be relative to the process's current working directory.
+*/
make_directory_all :: proc(path: string, perm: int = 0o755) -> Error {
return _mkdir_all(path, perm)
}
+/*
+Delete `path` and all files and directories inside of `path` if it is a directory.
+
+If `path` is relative, it will be relative to the process's current working directory.
+*/
remove_all :: proc(path: string) -> Error {
return _remove_all(path)
}
getwd :: get_working_directory
+/*
+Get the working directory of the current process.
+
+*Allocates Using Provided Allocator*
+*/
@(require_results)
get_working_directory :: proc(allocator: runtime.Allocator) -> (dir: string, err: Error) {
return _get_working_directory(allocator)
@@ -40,14 +64,29 @@ get_working_directory :: proc(allocator: runtime.Allocator) -> (dir: string, err
setwd :: set_working_directory
+/*
+Change the working directory of the current process.
+
+*Allocates Using Provided Allocator*
+*/
set_working_directory :: proc(dir: string) -> (err: Error) {
return _set_working_directory(dir)
}
+/*
+Get the path for the currently running executable.
+
+*Allocates Using Provided Allocator*
+*/
get_executable_path :: proc(allocator: runtime.Allocator) -> (path: string, err: Error) {
return _get_executable_path(allocator)
}
+/*
+Get the directory for the currently running executable.
+
+*Allocates Using Provided Allocator*
+*/
get_executable_directory :: proc(allocator: runtime.Allocator) -> (path: string, err: Error) {
path = _get_executable_path(allocator) or_return
path, _ = filepath.split(path)