The internal memory and memory disks use a DOS-compatible directory structure, the same as that used on disks on PCs. However, the two machines differ quite considerably in this area as described below.
To specify a file completely, EPOC uses a drive (or device), folder and filename:
\Jo
, which might in turn contain a folder called \Jo\Backup
, which might contain some files.\
or /
) or a colon (:
). Any trailing zeros on the filename are stripped.The filing system does not treat extensions as a special component of a filename except when parsing (i.e. for PARSE$). You can also use long filenames with embedded spaces and any number of dots like: OPL Reference manual
or Very.long.filename
.
To specify a file completely, you add the three parts together. The folder part must end with a backslash. So an OPL module named test
, in a folder called \Jo
in the internal memory can be specified as C:\Jo\test
. If this file were in the \Jo\Backup
folder, it would be completely specified as C:\Jo\Backup\Test
. If it were in the root folder, you would specify it as C:\Test
.
A full file specification may be up to 255 characters long for OPL.
In OPL, as in other applications, the files are kept on the drive and in the folder you specify.
OPL commands which specify a filename, such as OPEN, CREATE, gLOADBIT and so on, can also use any or all of the other parts that make up a full file specification. (Normally, the only other part you might use is the drive name, if the file were on a memory disk.) So for example, OPEN "C:\ADDR.TXT" tries to open a file called ADDR.TXT in the root folder of the internal disk.
You can use the PARSE$ function if you need to build up complex filenames. See Keyword Reference for more details of PARSE$.
The current folder for all commands is always C:\
unless it has been changed by the command SETPATH. Hence any use of a keyword which takes a filename as an argument will only look in the current folder and so if this is other than C:\
, it should be specified either by SETPATH or by including it in the filename. For example, to check whether the file Program1
in the directory D:\MyPrograms\
exists, either
SETPATH "d:\MyPrograms\" ... IF EXISTS ("Program1") ...
or
IF EXISTS ("d:\MyPrograms\Program1") ...
Use the MKDIR command to make a new folder. For example, MKDIR "C:\Mine\Temp" creates a C:\Mine\Temp
folder, also creating C:\Mine
if it is not already there. An error is raised if the chosen folder exists already. Use TRAP MKDIR to avoid this.
SETPATH sets the current folder for file access - for example,
SETPATH "C:\DOCUMENTS"
LOADM continues to use the folder of the running program, but all other file access will be to the newly specified folder.
Use RMDIR to remove a folder - for example, RMDIR "C:\MINE" removes the MINE folder on C:. A Does not exist error is raised if the folder does not exist. Use TRAP RMDIR to avoid this. A File is in use error will result if you try to remove a folder which contains open files.