The DIRECTORY command provides 7 different functions depending on the
qualifiers used.
Syntax:
DIRECTORY/COMPRESS <file>
Compresses one or more directories.
DIRECTORY/DUMP <file>
Provides a block level dump of a directory
DIRECTORY/REBUILD_MFD <device>
Recovers a corrupted MFD directory (000000.DIR)
DIRECTORY/RECOVER <file>
Recovers a corrupted directory
DIRECTORY/ALIAS <device>
Searches all directories on the device for alias file entries
DIRECTORY/EMPTY <device>
Searches the disk for empty directories.
DIRECTORY/VERSION=n <device>
Searches all directories on the device for files which
have at least n versions.
The qualifiers /ALIAS, /EMPTY, and /VERSION can be
combined in one command.
Other combinations of qualifiers are not possible.
1 – Parameters
file,(@file) The /COMPRESS , /DUMP and /RECOVER qualifier require a directory-file name as a parameter. A logical name or an indirect command file can also be used as a parameter eg.: DIR/COMPRESS @DIR.COM . Thus it is possible to generate a list with SEARCH device/OUTPUT=file and use that file as input to the DIRECTORY command. The list generated by DFU SEARCH will contain the device name in the file specification. If a filelist is used from another source which does not contain the device name, the /DEVICE must be used to append the device name to the file. device The /ALIAS, /EMPTY , /REBUILD_MFD and /VERSION qualifier require a device name as a parameter.
2 – Qualifiers
2.1 /ALIAS
Scan all directories on a disk for alias files.
2.2 /COMPRESS
Recreates and compresses the directory. Because directories
are alphabetically sorted files, deleting and entering files
randomly will create 'holes' in directory files. /COMPRESS
will remove these holes by rebuilding and truncating the
directory.
2.3 /DEVICE=device-name
Append the device name to the directory-file name. Can only be
used with /COMPRESS or /DUMP
2.4 /DUMP
Produces a dump of the directory file block by block.
This command may be usefull for debugging corrupted
or suspected directories.
2.5 /EMPTY
Scan the disk for empty directories.
2.6 /FILL_FACTOR
/FILL_FACTOR=percentage
This qualifier is only valid in combination with /COMPRESS.
Default behaviour for DFU is to compress a directory as tight
as possible; this is equivalent to /FILL_FACTOR=100.
By choosing a lower fill_factor DFU will leave some free
space in each directory block. /FILL_FACTOR may be between
50 and 100 %. Caution : choosing a fill_factor lower than
100% may fail if the directory file is not large enough.
In that case DFU will signal an error and advise using
a higher fill_factor.
2.7 /FORMAT
/FORMAT=format_string
Used with /VERSION and /OUTPUT. Create an output file using
the format as described in formatstring. The format string
MUST contains the !AS directive; DFU fills in the resultant
file there. Example :
DFU> DIR/VERSION=3/OUT=P.COM/FORMAT="$purge !AS"
2.8 /OUTPUT
/OUTPUT=filename
This qualifier redirects the output from DFU to an output file.
2.9 /REBUILD_MFD
/REBUILD_MFD
Rebuilds the disk's 000000.DIR directory and makes sure
the file backlinks to itself.
2.10 /RECOVER
/RECOVER
Rebuilds a corrupted directory file. Do not use this
command on critical (system)directories!
2.11 /STATISTICS
/STATISTICS
/NOSTATISTICS (default)
Controls whether CPU and I/O consumption of the
command are shown.
2.12 /TEST
This qualifier can be used only in conjunction with /COMPRESS.
When /TEST is specified DFU will show the results of a
directory compression without actually performing a compress
operation.
2.13 /TRUNCATE
/TRUNCATE(=n)
This qualifier is only valid in combination with /COMPRESS.
After compressing a directory DFU will NOT truncate the
empty blocks at the end of the directory , unless /TRUNCATE
is specified. A number 'n' may be specified to let DFU truncate
no further than 'n' blocks. ('n' will be rounded up to a
multiple of the disks cluster size.) Example: a 60 block
directory A.DIR can be compressed to 20 blocks. The results are:
DIR/COMPRESS --> A.DIR size 20/60 blocks.
DIR/COMPRESS/TRUNCATE --> A.DIR size 20/20 blocks.
DIR/COMPRESS/TRUNCATE=40 --> A.DIR size 20/40 blocks.
2.14 /VERSION
/VERSION=n
Scan all directories of a given device for files which have
at least 'n' versions.