aboutsummaryrefslogtreecommitdiff
path: root/docs/paths.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-05 00:40:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-05 00:40:00 -0500
commit9a3162633d358c9dc698b2733027981203514dc9 (patch)
tree38f6ebd8121f5dab2f04173dda8b9cefd2de1fdf /docs/paths.md
parentdba2d62d15d8233c189a109f97d7cda70fa7f6b7 (diff)
Shorten API docs
Diffstat (limited to 'docs/paths.md')
-rw-r--r--docs/paths.md104
1 files changed, 0 insertions, 104 deletions
diff --git a/docs/paths.md b/docs/paths.md
index 730eb496..cadc8116 100644
--- a/docs/paths.md
+++ b/docs/paths.md
@@ -65,8 +65,6 @@ intended. Paths can be created from text with slashes using
- [`func write_unique_bytes(path: Path, bytes: [Byte] -> Path)`](#write_unique_bytes)
### `append`
-
-**Description:**
Appends the given text to the file at the specified path, creating the file if
it doesn't already exist. Failure to write will result in a runtime error.
@@ -75,8 +73,6 @@ it doesn't already exist. Failure to write will result in a runtime error.
func append(path: Path, text: Text, permissions: Int32 = 0o644[32] -> Void)
```
-**Parameters:**
-
- `path`: The path of the file to append to.
- `text`: The text to append to the file.
- `permissions` (optional): The permissions to set on the file if it is being created (default is `0o644`).
@@ -92,8 +88,6 @@ Nothing.
---
### `append_bytes`
-
-**Description:**
Appends the given bytes to the file at the specified path, creating the file if
it doesn't already exist. Failure to write will result in a runtime error.
@@ -102,8 +96,6 @@ it doesn't already exist. Failure to write will result in a runtime error.
func append_bytes(path: Path, bytes: [Byte], permissions: Int32 = 0o644[32] -> Void)
```
-**Parameters:**
-
- `path`: The path of the file to append to.
- `bytes`: The bytes to append to the file.
- `permissions` (optional): The permissions to set on the file if it is being created (default is `0o644`).
@@ -119,8 +111,6 @@ Nothing.
---
### `base_name`
-
-**Description:**
Returns the base name of the file or directory at the specified path.
**Signature:**
@@ -128,8 +118,6 @@ Returns the base name of the file or directory at the specified path.
func base_name(path: Path -> Text)
```
-**Parameters:**
-
- `path`: The path of the file or directory.
**Returns:**
@@ -144,8 +132,6 @@ The base name of the file or directory.
---
### `by_line`
-
-**Description:**
Returns an iterator that can be used to iterate over a file one line at a time,
or returns a null value if the file could not be opened.
@@ -154,8 +140,6 @@ or returns a null value if the file could not be opened.
func by_line(path: Path -> func(->Text?)?)
```
-**Parameters:**
-
- `path`: The path of the file.
**Returns:**
@@ -179,8 +163,6 @@ for line in (/dev/stdin):by_line()!:
---
### `children`
-
-**Description:**
Returns a list of children (files and directories) within the directory at the specified path. Optionally includes hidden files.
**Signature:**
@@ -188,8 +170,6 @@ Returns a list of children (files and directories) within the directory at the s
func children(path: Path, include_hidden=no -> [Path])
```
-**Parameters:**
-
- `path`: The path of the directory.
- `include_hidden` (optional): Whether to include hidden files, which start with a `.` (default is `no`).
@@ -205,8 +185,6 @@ A list of paths for the children.
---
### `create_directory`
-
-**Description:**
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.
@@ -215,8 +193,6 @@ any of the parent directories do not exist, they will be created as needed.
func create_directory(path: Path, permissions=0o755[32] -> Void)
```
-**Parameters:**
-
- `path`: The path of the directory to create.
- `permissions` (optional): The permissions to set on the new directory (default is `0o644`).
@@ -231,8 +207,6 @@ Nothing.
---
### `exists`
-
-**Description:**
Checks if a file or directory exists at the specified path.
**Signature:**
@@ -240,8 +214,6 @@ Checks if a file or directory exists at the specified path.
func exists(path: Path -> Bool)
```
-**Parameters:**
-
- `path`: The path to check.
**Returns:**
@@ -256,8 +228,6 @@ func exists(path: Path -> Bool)
---
### `extension`
-
-**Description:**
Returns the file extension of the file at the specified path. Optionally returns the full extension.
**Signature:**
@@ -265,8 +235,6 @@ Returns the file extension of the file at the specified path. Optionally returns
func extension(path: Path, full=yes -> Text)
```
-**Parameters:**
-
- `path`: The path of the file.
- `full` (optional): Whether to return everything after the first `.` in the
base name, or only the last part of the extension (default is `yes`).
@@ -290,8 +258,6 @@ no file extension.
---
### `files`
-
-**Description:**
Returns a list of files within the directory at the specified path. Optionally includes hidden files.
**Signature:**
@@ -299,8 +265,6 @@ Returns a list of files within the directory at the specified path. Optionally i
func files(path: Path, include_hidden=no -> [Path])
```
-**Parameters:**
-
- `path`: The path of the directory.
- `include_hidden` (optional): Whether to include hidden files (default is `no`).
@@ -316,8 +280,6 @@ A list of file paths.
---
### `glob`
-
-**Description:**
Perform a globbing operation and return an array of matching paths. Some glob
specific details:
@@ -332,8 +294,6 @@ specific details:
func glob(path: Path -> [Path])
```
-**Parameters:**
-
- `path`: The path of the directory which may contain special globbing characters
like `*`, `?`, or `{...}`
@@ -363,8 +323,6 @@ A list of file paths that match the glob.
---
### `is_directory`
-
-**Description:**
Checks if the path represents a directory. Optionally follows symbolic links.
**Signature:**
@@ -372,8 +330,6 @@ Checks if the path represents a directory. Optionally follows symbolic links.
func is_directory(path: Path, follow_symlinks=yes -> Bool)
```
-**Parameters:**
-
- `path`: The path to check.
- `follow_symlinks` (optional): Whether to follow symbolic links (default is `yes`).
@@ -392,8 +348,6 @@ func is_directory(path: Path, follow_symlinks=yes -> Bool)
---
### `is_file`
-
-**Description:**
Checks if the path represents a file. Optionally follows symbolic links.
**Signature:**
@@ -401,8 +355,6 @@ Checks if the path represents a file. Optionally follows symbolic links.
func is_file(path: Path, follow_symlinks=yes -> Bool)
```
-**Parameters:**
-
- `path`: The path to check.
- `follow_symlinks` (optional): Whether to follow symbolic links (default is `yes`).
@@ -421,8 +373,6 @@ func is_file(path: Path, follow_symlinks=yes -> Bool)
---
### `is_socket`
-
-**Description:**
Checks if the path represents a socket. Optionally follows symbolic links.
**Signature:**
@@ -430,8 +380,6 @@ Checks if the path represents a socket. Optionally follows symbolic links.
func is_socket(path: Path, follow_symlinks=yes -> Bool)
```
-**Parameters:**
-
- `path`: The path to check.
- `follow_symlinks` (optional): Whether to follow symbolic links (default is `yes`).
@@ -447,8 +395,6 @@ func is_socket(path: Path, follow_symlinks=yes -> Bool)
---
### `is_symlink`
-
-**Description:**
Checks if the path represents a symbolic link.
**Signature:**
@@ -456,8 +402,6 @@ Checks if the path represents a symbolic link.
func is_symlink(path: Path -> Bool)
```
-**Parameters:**
-
- `path`: The path to check.
**Returns:**
@@ -472,8 +416,6 @@ func is_symlink(path: Path -> Bool)
---
### `parent`
-
-**Description:**
Returns the parent directory of the file or directory at the specified path.
**Signature:**
@@ -481,8 +423,6 @@ Returns the parent directory of the file or directory at the specified path.
func parent(path: Path -> Path)
```
-**Parameters:**
-
- `path`: The path of the file or directory.
**Returns:**
@@ -497,8 +437,6 @@ The path of the parent directory.
---
### `read`
-
-**Description:**
Reads the contents of the file at the specified path or a null value if the
file could not be read.
@@ -507,8 +445,6 @@ file could not be read.
func read(path: Path -> Text?)
```
-**Parameters:**
-
- `path`: The path of the file to read.
**Returns:**
@@ -527,8 +463,6 @@ raised.
---
### `read_bytes`
-
-**Description:**
Reads the contents of the file at the specified path or a null value if the
file could not be read.
@@ -537,8 +471,6 @@ file could not be read.
func read_bytes(path: Path -> [Byte]?)
```
-**Parameters:**
-
- `path`: The path of the file to read.
**Returns:**
@@ -557,8 +489,6 @@ returned.
---
### `relative`
-
-**Description:**
Returns the path relative to a given base path. By default, the base path is the current directory.
**Signature:**
@@ -566,8 +496,6 @@ Returns the path relative to a given base path. By default, the base path is the
func relative(path: Path, relative_to=(./) -> Path)
```
-**Parameters:**
-
- `path`: The path to convert.
- `relative_to` (optional): The base path for the relative path (default is `./`).
@@ -583,8 +511,6 @@ The relative path.
---
### `remove`
-
-**Description:**
Removes the file or directory at the specified path. A runtime error is raised if something goes wrong.
**Signature:**
@@ -592,8 +518,6 @@ Removes the file or directory at the specified path. A runtime error is raised i
func remove(path: Path, ignore_missing=no -> Void)
```
-**Parameters:**
-
- `path`: The path to remove.
- `ignore_missing` (optional): Whether to ignore errors if the file or directory does not exist (default is `no`).
@@ -608,8 +532,6 @@ Nothing.
---
### `resolved`
-
-**Description:**
Resolves the absolute path of the given path relative to a base path. By default, the base path is the current directory.
**Signature:**
@@ -617,8 +539,6 @@ Resolves the absolute path of the given path relative to a base path. By default
func resolved(path: Path, relative_to=(./) -> Path)
```
-**Parameters:**
-
- `path`: The path to resolve.
- `relative_to` (optional): The base path for resolution (default is `./`).
@@ -637,8 +557,6 @@ The resolved absolute path.
---
### `subdirectories`
-
-**Description:**
Returns a list of subdirectories within the directory at the specified path. Optionally includes hidden subdirectories.
**Signature:**
@@ -646,8 +564,6 @@ Returns a list of subdirectories within the directory at the specified path. Opt
func subdirectories(path: Path, include_hidden=no -> [Path])
```
-**Parameters:**
-
- `path`: The path of the directory.
- `include_hidden` (optional): Whether to include hidden subdirectories (default is `no`).
@@ -666,8 +582,6 @@ A list of subdirectory paths.
---
### `unique_directory`
-
-**Description:**
Generates a unique directory path based on the given path. Useful for creating temporary directories.
**Signature:**
@@ -675,8 +589,6 @@ Generates a unique directory path based on the given path. Useful for creating t
func unique_directory(path: Path -> Path)
```
-**Parameters:**
-
- `path`: The base path for generating the unique directory. The last six letters of this path must be `XXXXXX`.
**Returns:**
@@ -695,8 +607,6 @@ created:remove()
---
### `write`
-
-**Description:**
Writes the given text to the file at the specified path, creating the file if
it doesn't already exist. Sets the file permissions as specified. If the file
writing cannot be successfully completed, a runtime error is raised.
@@ -706,8 +616,6 @@ writing cannot be successfully completed, a runtime error is raised.
func write(path: Path, text: Text, permissions=0o644[32] -> Void)
```
-**Parameters:**
-
- `path`: The path of the file to write to.
- `text`: The text to write to the file.
- `permissions` (optional): The permissions to set on the file if it is created (default is `0o644`).
@@ -723,8 +631,6 @@ Nothing.
---
### `write_bytes`
-
-**Description:**
Writes the given bytes to the file at the specified path, creating the file if
it doesn't already exist. Sets the file permissions as specified. If the file
writing cannot be successfully completed, a runtime error is raised.
@@ -734,8 +640,6 @@ writing cannot be successfully completed, a runtime error is raised.
func write(path: Path, bytes: [Byte], permissions=0o644[32] -> Void)
```
-**Parameters:**
-
- `path`: The path of the file to write to.
- `bytes`: An array of bytes to write to the file.
- `permissions` (optional): The permissions to set on the file if it is created (default is `0o644`).
@@ -751,8 +655,6 @@ Nothing.
---
### `write_unique`
-
-**Description:**
Writes the given text to a unique file path based on the specified path. The
file is created if it doesn't exist. This is useful for creating temporary
files.
@@ -762,8 +664,6 @@ files.
func write_unique(path: Path, text: Text -> Path)
```
-**Parameters:**
-
- `path`: The base path for generating the unique file. This path must include
the string `XXXXXX` in the file base name.
- `text`: The text to write to the file.
@@ -783,8 +683,6 @@ created:remove()
---
### `write_unique_bytes`
-
-**Description:**
Writes the given bytes to a unique file path based on the specified path. The
file is created if it doesn't exist. This is useful for creating temporary
files.
@@ -794,8 +692,6 @@ files.
func write_unique_bytes(path: Path, bytes: [Byte] -> Path)
```
-**Parameters:**
-
- `path`: The base path for generating the unique file. This path must include
the string `XXXXXX` in the file base name.
- `bytes`: The bytes to write to the file.