Using files in ResiDOS

Filenames consist of an 8-character name, optionally followed by a full stop ( . ) and an extension of up to 3 characters. The characters allowed are:

Although extensions are not needed by BASIC or ResiDOS, you may find it helpful to name files in a consistent way, so that all BASIC programs have an extension of .BAS, for example.

Some example filenames are:


Some commands can have wildcards provided in their filenames. These are used to match multiple files. The following wildcard characters are allowed:

Wildcard characters can be used in either the name or extension part of the filename. Some examples are:

LOADing and SAVEing files

You can load and save files to and from the hard disk or CompactFlash card using the standard LOAD and SAVE syntax, but adding a % sign after the command name. For example:

Note that DATA files are not currently supported, although BASIC programs, CODE files and SCREEN$ are.

If you attempt to SAVE a file when one already exists with the same name, the existing file will be renamed by changing its extension to .BAK, before the new file is saved. If there was an existing .BAK file of the same name, it will be automatically deleted.

You can also LOAD any type of file that was not created by the Spectrum (standard PC text files, for example), using LOAD %"name" CODE. If you do not specify a start address, then 32768 will be used as the default. Such files can alternatively be LOADed using the SCREEN$ keyword, although this obviously only really makes sense if they are Spectrum screen dumps.

Additionally, snapshot files in the standard .SNA or .Z80 file formats (including those saved by the Task Manager, which are in .Z80 format) can be reloaded using the command:

This command can load 48K and 128K snapshots, although you will get an "out of memory" error if you try to load a 128K snapshot when in 48K mode. Note also that the command decides which format the snapshot is in from the file extension, so be sure to name your snapshots with the appropriate extension (.Z80 or .SNA).

To aid compatiblity with certain snapshots, there are two additional options with this command. Use "+" to make the snapshot loader use a small amount of screen memory (normally it uses the stack area, which is okay in most cases). Use "-" to run the snapshot using the Spectrum's built-in ROM rather than the patched one used with ResiDOS. Either or both of these options may be used, eg:

Changing BASIC auto-run status

It is not possible to MERGE files in ResiDOS, but you can change whether or not a BASIC program auto-runs, using the LINE command:

If you specify a line number of 0, then the BASIC program will no longer auto-run.

Cataloguing files

To show a list of all files on the current drive in the current user area, use one of the following:

You can also specify a string containing a drive, path and/or user area, to see files in that particular location (otherwise the defaults are assumed). The string can also contain a filename or wildcards, and will display only those files which match the string.

Additionally, you can add the + character at the end of the command to show all files (including system files, which are normally hidden) together with the attributes for each file. Some additional information is also given for BASIC and CODE files saved by ResiDOS.

Finally, you can specify a stream number, so that you can (for example) print the catalog listing. (This also applies to all other commands in ResiDOS which just produce a listing of information).

Some examples are:

Deleting files

To erase files from the hard disk, use one of the following commands:

You can use wildcards in order to erase many files at the same time, but be careful if using this facility!

Copying files

You can make a copy of file to a new file with a different name, or copy one or more files (using wildcards) to a different drive, user area or directory. If you specify "" as the destination, then the current location is used. Some examples are:

Renaming files

To rename a file, use:

This must be a single file (you cannot use wildcards). It is possible to use this command to change the user area for a file (but not the drive or directory), simply by specifying the same name with a different user area.

Changing file attributes

You can add or remove various file attributes from a file (or group of files, using wildcards). The possible attributes are:

Protected files cannot be erased or changed, and system files cannot be copied and are not normally listed in catalogs (only in expanded catalogs). You can add or remove a single attribute at a time, by using a "+" or "-" character, as in the following examples:

Back to the ResiDOS home page