This page was last modified 14:59, 8 November 2021 by Mars2000you. Based on work by Gdx and Pgimeno and others.



Lists the contents of the disk in a drive when available.

If you use version 2 of Disk BASIC, then FILES will list the contents of the current directory in a drive (files and subdirectories).

Remark: On systems without disk drive it will return "Illegal function call"-error and not a "Syntax error" message, because FILES is actually implemented in the standard MSX-BASIC instructions as reserved word, but can have the appropriate effect only when an internal or external disk drive is available.


FILES "<Device>:\<Path>\<Filename>",L

The L parameter is optional.


  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name.
  • Character backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.


<Device> is the name for used device. It can only be a disk drive.

If you don't specify the drive, the computer will display the file(s) of the currently active drive (by default, it's drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control up to 2 drives.

<Path> is used to specify the location in folders of the files you want to display. Each folder name in path are separate by a backslash (\). This parameter is only available in version 2 of Disk BASIC.

<Filename> is the file name to search. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.

The parameter L is only available in version 2 of Disk BASIC.

If you don't specify it (or can't specify it because you are using version 1 of Disk BASIC), all files in the file-listing will use 8 characters for the filename, a dot (.) and 3 characters for the extension.

If you specify this parameter, the file-listing will be in long format. That is, each file name is displayed on one line with its attributes and its size.

If you enter only FILES, the computer will display all the files of the currently active drive (by default, it's drive A:).


FILES "B:"  'Show all files on drive B: 
FILES "M*.*" 'Show all files with a name beginning with character M
FILES "*.BAS" 'Show all files with the extension ".BAS" 
FILES "*.*" 'Show all the files (same effect as FILES without any pattern)

Disk Basic 2.0 has support for sub-directories.

On Japanese machines the Yen symbol (¥) must be used instead of the backslash (\).

Dot (.) represents the current working directory, Dot Dot (..) represents the directory before the current (one level up).

FILES "\GAMES\APP1"  'Shows the contents of the \GAMES\APP1 directory 
.            ..             GAME.BAS
FILES "\GAMES\APP1",L 'Long listing with file attributes and sizes
.            d----                0
..           d----                0
GAME.BAS     -----             4096

Related to



Disk BASIC 1.0 or higher / both modes of Nextor OS