browser

File Device

device-file
calendarsave
The File device provides basic access to the file system (read, write, or delete files).
;file
.macro file.path              $30
.macro file.type              $32
.macro file.size              $33
.macro file.success           $35
.macro file.length            $37
.macro file.read              $39
.macro file.write             $3B
.macro file.operation         $3D
=== [2][RW] path The address of the string corresponding to the name or path to the file or directory to access. === [1][RO] type The type of the file being accessed. It can be set to one of the following values: dot-single $00 - not accessible dot-single $01 - file dot-single $02 - directory === [2][RO] size The size of the file being processed (zero for directories). Files larger than 64KB will still show up as 64KB in size. === [2][RO] success The total bytes being read or written by the last operation. === [2][RW] length The length of the read and write buffer in bytes. === [2][RW] read The address of the area of memory where data read from the file will be read into (up to file.length bytes). If the file being accessed is a directory, its content will be listed on separate lines, in the following format: <type> <size> <name> e.g. 01 003B test1.txt 01 0234 test2.txt 02 0000 example Where: dot-single Type indicates either a file (01) or a directory (02). dot-single Size is the size (up to 64KiB) of the file in bytes, in hexadecimal format. dot-single Name is the name of the file. === [2][RW] write The address of the area of memory containing the data to write to the file (up to file.length bytes). === [1][RW] operation The operation to perform on the specified file. If an error occurs, it will be written to the system.error address, starting with 3 as high nibble. dot-single $01 - read dot-single $02 - write dot-single $03 - append dot-single $04 - delete