From a5285fc474570cb71749477291d5430cede1f1d2 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 7 Apr 2021 21:11:31 -0400 Subject: Add some missing file metadata functionality --- docs/spec/system.html | 19 ++++++++++++++++--- 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 @@

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.

@@ -129,7 +129,7 @@ - + @@ -151,9 +151,22 @@ + + + +
Type"none", "file", or "dir"A character indicating the file's type
CreatedPermissions Query or set file permissions
OwnerQuery or set owner user ID and group ID number
-

Times are Unix timestamps, that is, seconds since the Unix epoch, as used by time system values.

+

Times are Unix timestamps, that is, seconds since the Unix epoch, as used by 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 '-'.

+

File access

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, Rename and Copy must give an error if a file exists at 𝕨, and CreateDir if a file exists at 𝕩, while Chars, Lines, and Bytes can overwrite the contents of an existing file 𝕨. However, these three functions must give an error if 𝕨 exists and is a directory.

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 -- cgit v1.2.3