browser

File Device

device-file
calendarsave
The File device provides basic access to the file system (read, write, copy, move, symlink, or delete files and execute external commands).
;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. If the operation to perform is copy, move, or symlink, the path must be comprised by the source and destination paths, separated by |. === [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] result Depending on the operation, this indicates: dot-single the number of bytes read/written (read, write, append, copy) dot-single non-zero if the operation succeeded (move, symlink) dot-single the return value of the executed command (execute) === [2][RW] length The length of the read/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. If the operation is set to execute, if this address and length are set, stout and stderr will be captured instead of being printed. === [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 dot-single $05 - copy dot-single $06 - move dot-single $07 - symlink dot-single $08 - execute