dec6cf3da3
FossilOrigin-Name: 6f7566eab5a787d4336a97008c00226f3a5a9c31d13ff65a2d21a7df32aa8a8d
131 lines
1.8 KiB
Text
131 lines
1.8 KiB
Text
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:R
|
|
|
|
-n
|
|
|
|
Constant for opening a file in READ mode.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:R+
|
|
|
|
-n
|
|
|
|
Constant for opening a file in READ & WRITE
|
|
mode.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:W
|
|
|
|
-n
|
|
|
|
Constant for opening a file in WRITE mode.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:A
|
|
|
|
-n
|
|
|
|
Constant for opening a file in APPEND mode.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:open
|
|
|
|
sm-h
|
|
|
|
Open a named file (`s`) with the given mode
|
|
(`m`). Returns a handle identifying the file.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:close
|
|
|
|
h-
|
|
|
|
Given a file handle, close the file.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:read
|
|
|
|
h-c
|
|
|
|
Given a file handle, read and return the next
|
|
character in it.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:write
|
|
|
|
ch-
|
|
|
|
Write a character to the file represented by
|
|
the handle.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:tell
|
|
|
|
h-n
|
|
|
|
Return the current offset into a file.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:seek
|
|
|
|
nh-
|
|
|
|
Move the current offset into a file to the
|
|
specified one.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:size
|
|
|
|
h-n
|
|
|
|
Given a file handle, return the size of the
|
|
file in bytes.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:delete
|
|
|
|
s-
|
|
|
|
Given a file name, delete the file.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:flush
|
|
|
|
h-
|
|
|
|
Given a handle, flush any pending writes to
|
|
disk.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:exists?
|
|
|
|
s-f
|
|
|
|
Given a file name, return `TRUE` if it exists
|
|
or `FALSE` if it does not.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
file:slurp
|
|
|
|
as-
|
|
|
|
Given an address and a filename, read the
|
|
file contents into the buffer starting at
|
|
the address.
|
|
|
|
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|