==================== 3. DTA: Directory/Tree/Attributes ====================
DTA is a versatile file directory utility, a convenient alternative to
DOS's DIR, TREE, ATTRIB commands that can also find and identify files. Its
output can be extensively customized for various purposes from archival
printouts or labels to everyday use. Despite its small size, DTA offers many
features: it can display a directory tree; search an entire tree for files;
view initial text to identify files; select by attributes, time/date, or
size; change attributes or time/date; or display several groups of files, or
all except certain files.
USAGE
C> DTA {filespec1} {{,}filespec2...} {/options} "{}"=optional
Each "filespec" may include a drive, path, or wildcards. Either spaces
or commas may separate multiple filespecs; if these are a list to be acted
upon by /C or /@, then they inherit the drive/path of previous ones (and
otherwise, they don't). The filename, if omitted, defaults to "*.*"; a
directory name alone expands to "DIRNAME\*.*" (unless /D is used).
While DTA is scanning through directories for a /T display or /G search,
or once its display has paused at the end of the screen for a keystroke, you
can press ^C to abort the operation if you wish.
Output can be redirected to a file or device in the standard DOS manner
">NAME", but not with color output; you must select monochrome (/M).
Pagination (/P) should also be disabled, to avoid having to press a key at a
prompt you won't see.
INTERPRETING THE DISPLAY
FILE SIZE and DISK SPACE are seldom useful to specify to the exact byte,
as the DOS DIR command does. Instead, DTA displays sizes rounded up to the
nearest kilobyte (1k is 1024 bytes) or tenth of a megabyte (1m is 1024k, or
1,048,576 bytes). Directories (if listed) are identified by "Dir" in the
file size column, their contents not included in the summary totals. The
"total" is simply the sum of the individual file sizes shown. The "used"
amount is the physical space actually dedicated to those files on the disk,
which is generally larger due to the allocation of disk space in discrete
units (clusters) of media-dependent size, ranging from as little as 128 bytes
on a RAMdisk or 512 on a diskette, to 16k or more on a large hard disk; the
same 500-byte file may "use" 1k or 32k, depending on the drive. Used and
free space for the entire drive may also be shown, on smaller media where
such cautionary information is relevant.
ATTRIBUTES, when displayed, show a letter ("A,R,H,S") if set, or a dot
"." if clear. DOS sets the "A"rchive attribute automatically when files are
modified, in case you want to use software (like the MFD utility CPY, or DOS
XCOPY) that backs just those files up to another drive and clears the
attribute again. The "R"ead-only attribute prevents a file from being
changed or deleted, though it can be read and copied. The "H"idden and
"S"ystem attributes both exclude items from normal searches, making them
inaccessible by ordinary DOS file commands. But DTA can show and operate on
them, and does so by default (unless you use the options "/hs").
TIME/DATE, when displayed, appear in the appropriate format for your DOS
country setting, unless you've customized DTA.COM or used a different entry
format (US, European, or Numeric) with the /B, /L, or /@ options. The date
of a volume is when the disk was labeled; of a directory, when created; of a
file, when last modified. Years display as two digits with "80-99" meaning
19xx, and "00-79", 20xx. (MSDOS dates begin at 1980.)
FILE TEXT, when displayed, appears as one or several lines in an
abbreviated format with many duplicate or non-alphabetic characters filtered
out. If the initial part of a file contains a sizable proportion of binary
(non-text) data, DTA won't attempt to display it, reporting "Bin" instead.
OPTIONS
By default, DTA displays a list of all specified files, along with their
sizes and some disk space information. However, many options are available.
These scan an entire drive, not just a single directory:
/T - display TREE, starting at specified (or current) directory
/G - GLOBAL search for file(s) throughout the drive, starting at
specified (or root) directory
These affect the information displayed:
/F - FULL listing: for files, show attributes, time/date, and LFN also;
for tree/global search, show file size information also;
for text view, show a few more lines of text
/W - WIDE listing (like DIR /W), five columns of filenames only
/V - VIEW initial text of files listed
These affect the format:
/O - ORDER: /O - by row (horizontally) instead of column (vertically)
/O2 - by file extension, i.e. ".COM"
/O3 - by file size (to nearest K; largest first)
/O4 - by file date (latest first)
/M - use MONOCHROME (MSDOS) output instead of color
/P - PAUSE for keystroke after each full screen
These determine which items are selected:
/X - EXCEPT: select only items OTHER than those specified
/D - DIRECTORIES instead of files
/U - UNIVERSAL listing, both directories and files
/B - files dated BEFORE specified date,time
/L - files dated LATER than specified date,time
/K - select files by specified size in K ("+"=greater, "-"=less)
/A,H,R,S - only items WITH the specified attributes
/a,h,r,s - only items WITHOUT these attributes
These change the DOS directory information for items selected:
/@ - set timestamp on items to following date,time
/C - CHANGE attributes of items to the following settings
Given an argument without wildcards, the single item displays with full
information (as if you had used /F) since there is room. Unlike DOS DIR, DTA
skips the omnipresent entries ".." or ".", even if /U or /D is used. Note
how using the /D option to act on directories themselves suppresses their
usual automatic expansion into a filespec "\*.*":
DTA \DIRNAM shows all its FILES, same as DTA \DIRNAM\*.*
DTA \DIRNAM /D shows directory \DIRNAM ITSELF
DTA \DIRNAM\*.* /D shows all SUBDIRECTORIES in it
When more items than will fit on a single line are displayed, DTA
defaults to vertical (column) ordering, alphabetically by name. The order
option /O alone gives horizontal (row) order instead. /O2, 3, or 4 will sort
first by file extension (i.e. ".COM"), or by file size, or by date, rather
than name. (Secondary sorting remains by name.) The way to remember /O2-4
is that the extension, size, and date are the 2nd, 3rd, and 4th things listed
in a full DTA display, after the name. You can also use /O1 to revert to
name order if you have another installed as your default.
The view option /V is useful when file names alone don't remind you
exactly what they contain; it produces a single column of output, with a
compact display (one line, or several if combined with /F) of any initial
text of each file that appears readable. Note that some documents created by
word processors actually contain lots of binary data, and may not display;
while program and data files may also happen to contain displayable text.
DTA includes hidden and system items by default: the /H,S options don't
mean include those items also, but those only; to exclude them, use /h,s.
All the file attribute options /A,R,H,S are case-sensitive (uppercase=set,
lower=clear) and position-sensitive. WITHOUT or BEFORE the change option /C,
they SELECT the items to be listed or acted upon; AFTER /C, they represent
CHANGES to be made to the selected items. The /C option can incidentally be
used alone (with NO following attributes to change) simply to cause
attributes to display instead of file sizes.
The /K option should be followed by a number from 0 to 999; files of that
many kilobytes only will be selected. Add a "-" after the size to include
smaller files as well, or a "+" to include larger ones: for example, "/K100+"
gives all files of 100k or more.
The /B,/L,/@ options may be followed by a date and time, separated by a
comma (or either alone). If omitted, the date defaults to today, the time to
0 hours (12am) -- except that /@ alone means today, NOW. The year is entered
as two digits only; 80-99 are taken as 19xx, 00-79 as 20xx. DTA recognizes
U.S., European, or Numeric formats by the punctuation used to enter them:
U.S.(M/D/Y,H:MMa-p) Euro (D.M.Y,H:MM) Num (Y-M-D,HHMM)
3/25/90,1:45p = 25.3.90,13:45 = 90-3-25,1345
/B and /L may be combined to specify an interval of time. For additional
convenience, you can specify a relative time instead (so many days or hours
ago) by using a "-" sign: "-3" means 3 days ago, "-,2" 2 hours ago. The null
date "0/0/00" alone may be entered to (re)set a blank timestamp.
Most options can be combined, for great power and selectivity. However,
options /T,G,X don't allow multiple filename arguments. If you specify
certain contradictory selection or formatting options like /U and /D, the
later one may override the earlier one; other combinations of options
(especially involving /T or /G) simply aren't supported and will produce an
error message. Note also that if no directory is specified, a global search
(/G) starts by default at the root, for the entire drive; if you want it to
search only from the current directory down, use "DTA . /G".
CAUTION: the /@ and /C options actually CHANGE the DOS timestamp and
attributes for files! Timestamps provide valuable information about the age
and revision of a file, and shouldn't be changed without good reason; some
software (especially Windows) expects its files to have certain attributes.
If the DOS FASTOPEN feature is in use, /@ may fail to change the timestamp
of a file. /C can change the attributes of directories as well as files, but
/@ cannot change a directory's creation time. /@ always sets seconds to 00.
EXAMPLES
FILES and DIRECTORIES...
C> dta a:\*.doc a:\*.txt /v
Show all files *.DOC and *.TXT in the root directory on A:, with text view
C> dta a:\*.sys /xf
Show all files EXCEPT *.SYS, with "full" display: attribs, time/date, etc
C> dta \work /uo
Show all files AND directories in C:\WORK, ordered by row
C> dta /d
Show all subdirectories in the current directory
SIZES and TIMESTAMPS...
C> dta d: e: /k0
Show only empty (0k) files in the current directory on drives D: and E:
C> dta \work /l-2
Show only files in directory C:\WORK dated in the past two days
C> dta /b9/1/89
Show only files in current directory dated before 9/1/89
C> dta *.doc /l/b1700
Show only files *.DOC dated today before 1700 hrs (5:00pm)
C> dta log /@1.9.89,13:20
Change the timestamp of file C:LOG to 1 Sept 1989, 13:20 (1:20pm)
ATTRIBUTES...
C> dta /cp
Show all files *.* with their attributes, with no end-of-screen pause
C> dta *.doc /A
Show only files *.DOC in current directory with the Archive attribute
C> dta a: /SH
Show only files in current directory on A: which are System and Hidden
C> dta a: /Hca
Select only Hidden files on A: and clear their Archive attribute
TREE and GLOBAL SEARCH...
C> dta \work /tf
Show the directory tree starting from C:\WORK, including size information
C> dta /gl
Locate all files on drive C: that have been modified today
C> dta *.bak /gk100+f
Find all files *.BAK of 100k or larger on drive C:, and show total sizes
ERRORS
0 (such) items "NAME" - nothing exists by that NAME (or nothing matches
other criteria specified: attributes, date, size)
Invalid argument - incorrect or incomplete argument, or empty drive
Out of memory - not enough free memory to run DTA, or too many items
to list (try a more restrictive filespec)
Aborted - user pressed ^C
DTA sets the DOS return code, so that batch files can test the ERRORLEVEL
to determine subsequent action. Zero indicates a normal exit.
1 = invalid argument
2 = no items found
4 = out of memory
128 = user abort
|