home *** CD-ROM | disk | FTP | other *** search
- FF.EXE
-
- Utility for use with MS/DOS or PC/DOS on IBM PC/XT/AT and compatibles.
-
- Author: Bill Mayne
- 9707 Lawndale Dr.
- Silver Spring, MD 20901
- (301) 588-2308 (home: reasonable hours)
- (301) 899-4845 (answering machine: 24 hours)
-
- Copyright 1987.
-
- Changes: June 30, 1987 (first release of source code):
- (1) Allow options to entered before or after pathname.
- (2) Accept option for filesize range selection.
- (3) Default path changed to root directory.
- (4) If no filename is given default set to all files in the
- current directory and its descendents (".\*.*").
- (5) Accept options to specify a range of date/time stamps, so only
- files with dates in the given range will be selected. Default
- beginning would be earliest possible date and ending the maximum
- possible date and time. DOS only supports dates Jan. 1, 1980 or
- later.
-
- Permission is granted to the public to copy and use for non-commercial
- purposes. No compensation is requested, provided the program is not
- sold for profit. Registration is not required, but comments and
- suggestions for improvements are welcome. Anyone who modifies the
- source code is asked to contact the author and, pending approval of the
- changes, to include the old code and comments on the differences with
- any copies distributed to others.
-
- Purpose: Find files on a disk where filename and extent match a given
- value, with wildcards allowed. If a directory is specified, the search
- is limited to the subtree beginning with that directory. Displays
- directory, filename, extent, size, date, time and attributes. Selection
- may be on the basis of attributes and file size as well as file names.
- Output is to the console, but may be redirected or piped as usual in
- DOS.
-
- Syntax: FF [/options] [drive:][path\]filename[.ext]
- or: FF [drive:][path\]filename[.ext] [/options]
-
- If only drive is given, with no directory part, the root directory on
- that drive will be used. (Not the current directory on the specified
- drive, as with some DOS commands.) If no file or path name is given,
- the default is all files in the current directory and its descendents
- (".\*.*").
-
- Default options would be to traverse the entire subtree beginning with
- the root or specified directory and to display only files which are not
- hidden or system files. The display would include the path to each file
- along with the filename and extent.
-
- Options:
-
- /Smin:max - specifies range of file sizes to be selected, min thru max,
- inclusive. Max must be an unsigned decimal integer and have no
- leading blanks. Both min and max are optional. If max is omitted
- the separating colon should also be omitted. Default min is 0 and
- max is the largest long integer value.
- /Yfrom:to - specifies date/time range to select files. "from" and "to"
- are in the form "YYMMDDhhmm". The range is inclusive, and the
- defaults are the minimum and maximum possible values. Each is
- optional, but if only "to" is given, the colon is required as a
- place holder. You can also specify only most significant part of
- either, e.g. omit the time if only the date matters, or omit
- everything after year if only the year matters. "/y8605:86" says
- to find files with dates from May thru December 1986.
- /n - where n is a positive decimal integer (without sign) limits the
- depth of the search. 1=root or specified directory only,
- 2=root or specified directory plus first level of sub
- directories, etc. Default is the entire subtree. Subtrees are
- searched by recursion, so it is possible to run out of stack
- space if there is a very long path. The maximum length of a
- pathname plus the filename and extent is 127. The program has been
- tested with 16 levels of directories without running out of stack
- space.
-
- /D - display each directory containing matched files on a line by
- itself, followed by one line for each file showing filename and
- extent (plus other data) without the directory part. Default is
- is to show the full pathname of each file, without a separate line
- for directories. If the options exclude files by attributes it is
- possible that a directory name containing matching files will be
- displayed, even though the matching files will be excluded from
- the display by their attributes.
-
- Attribute specifiers:
-
- A = archive
- D = directory
- H = hidden
- S = system
- R = read only
-
- May be used with:
-
- /I - Include attributes. Use to specify D, H, or S, since these are
- not normally displayed.
- /X - Exclude attributes. Do not display files with these attributes,
- even if they would be selected otherwise. Use to exclude A and R.
- /R - Required attributes. Display only files having all of the
- specified list of attributes. If any of H, S, or D are required,
- they need not be specified with /I, since this is implied.
- Combinations such as "/ID/RH" are also supported, in which case
- both files and directories are shown only if they are hidden.
-
- Options may be in upper or lower case and may be given either before or
- after the filename part, but not both. (Filename, if given must be
- either the first or last argument, not in the middle.) There should be
- no spaces within an option specifier. Spaces may be placed between
- options, but are not required. The volume id attribute is not supported.
-
- Examples:
-
- (1) FF *.BAT
- Show all .BAT files on current disk.
- (2) FF /XA *.*
- Show all normal files on current drive which do not have the
- archive attribute set.
- (3) FF /RD A:\*
- or
- FF /RD A:*
- Show all directories on the A drive.
- (4) FF /RHS \UTIL\*.*
- Show all files in the directory UTIL on the current drive which
- are have hidden and system attributes.
-
- Background:
-
- This started out to be a simple replacement for the Norton Utilities
- FF.COM, which I do not know well but have seen on some other people's
- systems. Some of the shortcomings I saw may be my lack of knowledge of
- Norton's version, but I decided to write my own for the following
- reasons:
-
- (1) I didn't have a licensed copy of the Norton Utilities for each
- system where I wanted to use this function. Being a programmer
- myself and knowing how much work goes into software I was not
- willing to use pirat copies.
-
- (2) I found I couldn't interrupt the Norton Utilities with CTRL-C except
- when it found a file to display. Often I would have found what I
- wanted, but had to wait for the utility to finish its search before
- regaining control. (Setting BREAK ON would get around this, but I
- do not normally run with BREAK ON.) In this version, I test CTRL-C
- at the start of each new directory, so even if it contains no
- matching files execution is immediately stopped. (When files are
- found CTRL-C will work anyway, even the in middle of the directory
- since console output is taking place.)
-
- Other added features include:
-
- (1) Searching a given subtree rather than the entire disk and optionally
- restricting the depth of the search.
-
- (2) Presenting file names in the form of DOS names, with directory
- (optional) and a dot (and no blanks) between name and extent.
- This is more convenient for some intended uses where the output
- is redirected to a file and used to create .BAT files or read and
- used by .BAT file replacements such as Personal Rexx.
-
- (3) Selection on the basis of attributes and displaying attributes.
-
- (4) Selection on the basis of file size (/S option.)
-
- (5) Selection on the basis of file date and time (/Y option.)
-
- Disclaimer: This program has been tested and is free from known defects,
- but the author assumes no responsibility for consequential damages
- arising from the use of this program. Anyone discovering a defect is
- requested to contact the author.
-
- Source language is Microsoft C, version 4.0.
- Small memory model is used.