Contents |
Effect
Under MSX-DOS 1
Displays the names of files on disk with additional infos: size of each file, date for each file, time for each file, total number of files, number of free bytes on the disk
Notes:
- The hours are not displayed if you are in MODE 35 or lower
- The dates are not displayed in you are in MODE 28 or lower
- The sizes are not displayed if you are in MODE 19 or lower
Under MSX-DOS 2 / Nextor
Displays the names of the folders and files in the current folder or a specified folder with additional infos: volume name of disk, current folder, optional attributes of each file (see ATTRIB) of folder (see ATDIR), size of each file, date for each file or folder, hour for each file or folder, total number of files and corresponding Kb, number of free kB on the disk
Notes:
- The hours are not displayed if you are in MODE 38 or lower
- The dates are not displayed in you are in MODE 31 or lower
- The sizes are not displayed if you are in MODE 22 or lower
- When the directory of a sub-directory is displayed, the first two items listed will always be two special sub-directories called '.' and '..'. These are automatically created when a new directory is created. These folders allow '.' and '..' to be given in path names to signify the current and parent directories respectively.
Syntaxes
Under MSX-DOS 1
DIR /W /P <Device>:<Filename>
Under MSX-DOS 2 / Nextor
DIR /S /H /W /P /2 <Device>:\<Path>\<ItemName> + <Device>:\<Path>\<ItemName>....
Notes:
- 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. Backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
- Character slash (/) serves to declare an option. You can put the options after the command or behind all other parameters.
Parameters
<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 names of the files on 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 until 2 drives. |
<Path> is used to specify the location in folders of file or folder to display. Each folder name in path are separate by a backslash (\). This parameter is only available under MSX-DOS 2 / Nextor.
<Filename> is the file name to display. Wildcards can replace some characters in file name to get several files and/or folders. 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.
Unlike all other commands, it is possible to not specify the main filename or the filename extension:
- DIR and DIR *.* are actually the same command
- You can use the main filename followed by .* (FRED and FRED.* are equivalent for example)
- You can also use *. followed by the filename extension (.COM and *.COM are equivalent for example).
Note that if the '.' at the end of a main filename is given, then the extension is also assumed to have been given, so that the filename 'FRED.' is not equivalent to 'FRED.*', unlike the example above.
<ItemName> under MSX-DOS 2 / Nextor can be a file name (see above), but also a folder name for which you want to display all the files.
/S is used to allow also the display of system files. This parameter is available only since COMMAND2.COM 2.40.
/H is used to allow also the display of hidden files or folders. This parameter is only available under MSX-DOS 2 / Nextor.
/W is used to get a simplified display of the files with several filenames output per line. Folder names, file attributes, dates and times are not displayed. However, if you use COMMAND2.COM 2.41 or higher, the folders will be displayed in lower case.
The number of files displayed per line with the W parameter is also adjusted according to the screen width. If the width of the display is less than 13 characters, the filenames will wrap to the next line.
The non-/W display is designed to fit within a 40 column screen, but if fewer columns are available then some fields of the listing will not be shown so that the display will always fit on one line.
/P is used to allow a pause at the end of the screen when displaying the files until a key is pressed.
/2 is used to display two filenames per line. This display is designed to fit within a 80 column screen, but if fewer columns are available then some fields of the listing will not be shown so that the display will always fit on one line. This parameter is available only since COMMAND2.COM 2.40.
MSX-DOS 2 / Nextor allows to display simultaneously several specified (series of) files with the + part of the mentioned syntaxes. It is useful to display the files of several sub-directories for example.
Examples
Under MSX-DOS 1 and higher
A>DIR TEST
A>DIR B:*.COM /P
Under MSX-DOS 2 / Nextor
A>DIR \UTILS\X*.COM
A>DIR B:\HELP /W
A>DIR UTILS + HELP /P
Related to
ATDIR, ATTRIB, FREE, MODE, TYPE, XDIR (ASCII tool), XDIR (SceneTool)
Compatibility
MSX-DOS 1 with COMMAND.COM, MSX-DOS 2 / Nextor with COMMAND2.COM v2.20 and higher