Original Author Paul Laughton, 2011
Page 107
De Re BASIC!
File.dir <path_sexp>, Array$[] {,<dirmark_sexp>}
Returns the names of the files and directories in the path specified by <path_sexp>. The path is relative
to "<pref base drive>/rfo-basic/data/".
The names are placed into Array$[]. The array is sorted alphabetically with the directories at the top of
the list. If the array exists, it is overwritten, otherwise a new array is created. The result is always a one-
dimensional array.
A directory is identified by a marker appended to its name. The default marker is the string "(d)". You
can change the marker with the optional directory mark parameter <dirmark_sexp>. If you do not want
directories to be marked, set <dirmark_sexp> to an empty string, "".
Dir is a valid alias for this command.
File.exists <lvar>, <path_sexp>
Reports if the <path_sexp> directory or file exists. If the directory or file does not exist, the <lvar> will
contain zero. If the file or directory does exist, the <lvar> will be returned as not zero.
The default path is "<pref base drive>/rfo-basic/data/".
File.mkdir <path_sexp>
Before you can use a directory, the directory must exist. Use this command to create a directory named
by the path string <path_sexp>.
The new directory is created relative to the default directory "<pref base drive>/rfo-basic/data/". For
example:
To create a new directory, "homes", in "<pref base drive>/rfo_basic/data/", use the path
"homes/", or simply "homes".
To create a new directory, "icons", in the root directory of the SD card, use "../../icons".
Mkdir is a valid alias for this command.
File.rename <old_path_sexp>, <new_path_sexp>
The file or directory at old_path is renamed to new_path. If there is already a file present named
<new_path_sexp>, it is silently replaced.
The default path is "<pref base drive>/rfo-basic/data/".
The rename operation can not only change the name of a file or a directory, it can also move the file or
directory to another directory.
For example:
Rename "../../testfile.txt", "testfile1.txt"