From a7e38bd0e8a7b25f8d6ae8f5069e931026a7d8e7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 9 Apr 2022 15:59:45 -0400 Subject: =?UTF-8?q?=E2=80=A2file.MapBytes=20specification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/system.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/spec/system.html b/docs/spec/system.html index 17159837..7469fa06 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -254,6 +254,10 @@ Bytes Read from or write to entire file, as bytes + +MapBytes +Create a memory-mapped array aliasing the file +

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

@@ -264,6 +268,7 @@
  • Lines: BQN strings. The file is decoded as with chars, then split into lines by CR, LR, or CRLF line endings.
  • Bytes: Single-byte values, stored as BQN characters from @ to @+255.
  • +

    The MapBytes function only takes one argument, a filename, and returns an array matching the result of Bytes. However, the array data should be memory-mapped allowing it to be loaded into memory on use. The array and arrays derived from it (such as slices) may change in value if the underlying file is modified after MapBytes is called.

    The following short names can also be provided for file access. They can be provided, and use the definitions from above even if •file is not provided.

    @@ -288,6 +293,7 @@

    Open file object

    +

    Not yet specified.

    Input and output

    -- cgit v1.2.3