diff options
Diffstat (limited to 'api/paths.md')
| -rw-r--r-- | api/paths.md | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/api/paths.md b/api/paths.md index 7929e71f..ad6b894b 100644 --- a/api/paths.md +++ b/api/paths.md @@ -225,7 +225,7 @@ follow_symlinks | `Bool` | Whether to follow symbolic links. | `yes` ## Path.child ```tomo -Path.child : func(path: Path, child: Text -> [Path]) +Path.child : func(path: Path, child: Text -> Path) ``` Return a path that is a child of another path. @@ -791,6 +791,28 @@ follow_symlinks | `Bool` | Whether to follow symbolic links. | `yes` (./file.txt).set_owner(owner="root", group="wheel") ``` +## Path.sibling + +```tomo +Path.sibling : func(path: Path, name: Text -> Path) +``` + +Return a path that is a sibling of another path (i.e. has the same parent, but a different name). This is equivalent to `.parent().child(name)` + +Argument | Type | Description | Default +---------|------|-------------|--------- +path | `Path` | A path. | - +name | `Text` | The name of a sibling file or directory. | - + +**Return:** A new path representing the sibling. + + +**Example:** +```tomo +>> (/foo/baz).sibling("doop") += (/foo/doop) + +``` ## Path.subdirectories ```tomo |
