From 83839ce9eb4b0a2d38e6b950a8b63552e089d371 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 7 Apr 2021 07:39:47 -0400 Subject: Add CreateDir and List for directory manipulation --- docs/spec/system.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/spec/system.html b/docs/spec/system.html index d8a1e26d..5181867e 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -155,7 +155,7 @@

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

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 𝕨, 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.

+

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.

@@ -177,6 +177,10 @@ + + + + @@ -185,6 +189,10 @@ + + + + @@ -198,7 +206,8 @@
Copy file 𝕩 to path 𝕨
CreateDirCreate a directory at path 𝕩
Remove Delete file 𝕩
Recursively delete directory 𝕩 and all contents
ListReturn names of all files in directory 𝕩
Chars Read from or write to entire file, as characters
-

Rename and Copy return the path of the new file. Remove and RemoveDir return 1 to indicate successful removal (and error otherwise).

+

Rename, Copy, and CreateDir return the path of the new file. Remove and RemoveDir return 1 to indicate successful removal (and error otherwise).

+

List returns filenames only, without extensions. It lists all files and directories including hidden ones, but not the current and parent directory names . and ...

Functions Chars, Lines, and Bytes are all ambivalent. If only 𝕩 is given, then it is a filename, and the result is the contents of the file in the appropriate format. If there are two arguments, then 𝕨 is the filename and 𝕩 is the desired contents. These are written to the file, overwriting its contents, and the absolute filename 𝕨 is returned. The three formats are: