From 39b463ff60ea172d5f538310ec4e26b2a5427fb7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Apr 2025 19:12:27 -0400 Subject: Add Path.current_dir() as exposed method --- docs/paths.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs/paths.md') diff --git a/docs/paths.md b/docs/paths.md index 99891671..6cf986a7 100644 --- a/docs/paths.md +++ b/docs/paths.md @@ -49,6 +49,7 @@ intended. Paths can be created from text with slashes using - [`func child(path: Path, child:Text -> Path)`](#child) - [`func children(path: Path, include_hidden=no -> [Path])`](#children) - [`func create_directory(path: Path, permissions=0o755[32] -> Void)`](#create_directory) +- [`func current_dir(-> Path)`](#current_dir) - [`func exists(path: Path -> Bool)`](#exists) - [`func expand_home(path: Path -> Path)`](#expand_home) - [`func extension(path: Path, full=yes -> Text)`](#extension) @@ -357,6 +358,25 @@ Nothing. --- +### `current_dir` +Creates a new directory at the specified path with the given permissions. If +any of the parent directories do not exist, they will be created as needed. + +```tomo +func current_dir(-> Path) +``` + +**Returns:** +The absolute path of the current directory. + +**Example:** +```tomo +>> Path.current_dir() += (/home/user/tomo) +``` + +--- + ### `exists` Checks if a file or directory exists at the specified path. -- cgit v1.2.3