os/open
cfunction
src/core/os.c on line 2042, column 1
(os/open path &opt flags mode)
Create a stream from a file, like the POSIX open system call.
Returns a new stream. `mode` should be a file mode as passed to
`os/chmod`, but only if the create flag is given. The default mode
is 8r666. Allowed flags are as follows:
* :r - open this file for reading
* :w - open this file for writing
* :c - create a new file (O_CREATE)
* :e - fail if the file exists (O_EXCL)
* :t - shorten an existing file to length 0 (O_TRUNC)
Posix-only flags:
* :a - append to a file (O_APPEND)
* :x - O_SYNC
* :C - O_NOCTTY
Windows-only flags:
* :R - share reads (FILE_SHARE_READ)
* :W - share writes (FILE_SHARE_WRITE)
* :D - share deletes (FILE_SHARE_DELETE)
* :H - FILE_ATTRIBUTE_HIDDEN
* :O - FILE_ATTRIBUTE_READONLY
* :F - FILE_ATTRIBUTE_OFFLINE
* :T - FILE_ATTRIBUTE_TEMPORARY
* :d - FILE_FLAG_DELETE_ON_CLOSE
* :b - FILE_FLAG_NO_BUFFERING