diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-07 21:11:31 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-07 21:11:31 -0400 |
| commit | a5285fc474570cb71749477291d5430cede1f1d2 (patch) | |
| tree | 4d8a9cbe9f1e501afe388d39e6737240993c0e25 | |
| parent | 6ce0c822ae744af14a772e59e3e5435cc442ff71 (diff) | |
Add some missing file metadata functionality
| -rw-r--r-- | docs/spec/system.html | 19 | ||||
| -rw-r--r-- | spec/system.md | 15 |
2 files changed, 28 insertions, 6 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html index 5181867e..921ae3d1 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -114,7 +114,7 @@ </tbody> </table> <h3 id="file-metadata">File metadata</h3> -<p>Metadata functions may query information about a file or directory but do not read to or write from it. Each takes a path <code><span class='Value'>𝕩</span></code>, and <code><span class='Function'>Permissions</span></code> also allows new data in <code><span class='Value'>𝕨</span></code>. The returned data in any case is the specified property.</p> +<p>Metadata functions may query information about a file or directory but do not read to or write from it. Each takes a path <code><span class='Value'>𝕩</span></code>, and some functions also allow new data in <code><span class='Value'>𝕨</span></code>. The returned data in any case is the specified property.</p> <table> <thead> <tr> @@ -129,7 +129,7 @@ </tr> <tr> <td><code><span class='Function'>Type</span></code></td> -<td><code><span class='String'>"none"</span></code>, <code><span class='String'>"file"</span></code>, or <code><span class='String'>"dir"</span></code></td> +<td>A character indicating the file's type</td> </tr> <tr> <td><code><span class='Function'>Created</span></code></td> @@ -151,9 +151,22 @@ <td><code><span class='Function'>Permissions</span></code></td> <td>Query or set file permissions</td> </tr> +<tr> +<td><code><span class='Function'>Owner</span></code></td> +<td>Query or set owner user ID and group ID number</td> +</tr> </tbody> </table> -<p>Times are Unix timestamps, that is, seconds since the Unix epoch, as used by <a href="#time">time</a> system values.</p> +<p>Times are Unix timestamps, that is, seconds since the Unix epoch, as used by <a href="#time">time</a> system values. File permissions on Unix are a three-element list of numbers giving the permissions for the owner, group, and other users. The file type is one of the following characters for the POSIX file types, matching Unix <code><span class='Value'>ls</span> <span class='Function'>-</span><span class='Value'>l</span></code> with <code><span class='String'>'f'</span></code> instead of <code><span class='String'>'-'</span></code>.</p> +<ul> +<li><code><span class='String'>'f'</span></code>: File</li> +<li><code><span class='String'>'d'</span></code>: Directory</li> +<li><code><span class='String'>'l'</span></code>: Symlink</li> +<li><code><span class='String'>'p'</span></code>: Pipe (FIFO)</li> +<li><code><span class='String'>'s'</span></code>: Socket</li> +<li><code><span class='String'>'b'</span></code>: Block device</li> +<li><code><span class='String'>'c'</span></code>: Character device</li> +</ul> <h3 id="file-access">File access</h3> <p>File access functions read or write files, either by manipulating files as a whole or interacting with the contents. Whole-file functions cannot overwrite target files: that is, <code><span class='Function'>Rename</span></code> and <code><span class='Function'>Copy</span></code> must give an error if a file exists at <code><span class='Value'>𝕨</span></code>, and <code><span class='Function'>CreateDir</span></code> if a file exists at <code><span class='Value'>𝕩</span></code>, while <code><span class='Function'>Chars</span></code>, <code><span class='Function'>Lines</span></code>, and <code><span class='Function'>Bytes</span></code> can overwrite the contents of an existing file <code><span class='Value'>𝕨</span></code>. However, these three functions must give an error if <code><span class='Value'>𝕨</span></code> exists and is a directory.</p> <table> diff --git a/spec/system.md b/spec/system.md index 06722d76..5d977209 100644 --- a/spec/system.md +++ b/spec/system.md @@ -64,19 +64,28 @@ The following functions manipulate paths and don't access files. Each takes a re ### File metadata -Metadata functions may query information about a file or directory but do not read to or write from it. Each takes a path `𝕩`, and `Permissions` also allows new data in `𝕨`. The returned data in any case is the specified property. +Metadata functions may query information about a file or directory but do not read to or write from it. Each takes a path `𝕩`, and some functions also allow new data in `𝕨`. The returned data in any case is the specified property. | Name | Summary |---------------|-------------------------- | `Exists` | `1` if the file exists and `0` otherwise -| `Type` | `"none"`, `"file"`, or `"dir"` +| `Type` | A character indicating the file's type | `Created` | Time created | `Accessed` | Time of last access | `Modified` | Time of last modification | `Size` | Total size in bytes | `Permissions` | Query or set file permissions +| `Owner` | Query or set owner user ID and group ID number -Times are Unix timestamps, that is, seconds since the Unix epoch, as used by [time](#time) system values. +Times are Unix timestamps, that is, seconds since the Unix epoch, as used by [time](#time) system values. File permissions on Unix are a three-element list of numbers giving the permissions for the owner, group, and other users. The file type is one of the following characters for the POSIX file types, matching Unix `ls -l` with `'f'` instead of `'-'`. + +- `'f'`: File +- `'d'`: Directory +- `'l'`: Symlink +- `'p'`: Pipe (FIFO) +- `'s'`: Socket +- `'b'`: Block device +- `'c'`: Character device ### File access |
