home *** CD-ROM | disk | FTP | other *** search
-
-
- LF -- LOCATE FILE (c)1990, 1991 William Pemberton Version 3.2
- --------------------------------------------------------------
- Purpose: To find a file on a hard disk system or network and to
- execute a command on the file(s) if needed. LF is fast!
- Despite claims of other file search programs, LF proved to
- be just as fast as the fastest and much faster than other
- similar programs tested, and LF is NOVELL compatible.
-
- Syntax: LF [options] filespec [command string]
-
- Remarks: LF is similar to other file location utilities, except that
- LF looks across multiple drives (all drives on a hard disk
- and all drives to which you have access on a network), and
- LF also enable you to execute a command on the files that
- it locates. In addition, LF shows you the file even if it
- is marked hidden or located in a hidden directory.
-
- LF can be fully configured by the user. All command line
- options, except OLDER and NEWER, can be written back to the
- .EXE so that they then become the default options.
-
- LF searches for the given filespec (DOS wildcards are
- accepted) on all the disks beginning with the default
- or designated start drive. If a valid sub-directory
- is specified in the filespec, LF will search from that
- sub-directory down. For example, "LF \home\*.txt"
- would find the files \home\goo.txt, \home\joe\joe.txt,
- etc. but not find \temp\lf.txt.
-
- Options: The [options] mentioned in the "Syntax:" section above
- include the following (case is not important):
-
- /s - Start Drive
- /e - End Drive
- /o - Only Drive
- /c - Current Drive
- /i - Interactive
- /y - Not Interactive
- /a - Find files with the given attribute(s)
- /NEWer - Find files newer then specified
- number of days
- /OLDer - Find files older then specified
- number of days
- /w - Writes options back to .EXE
-
- The OLDER and NEWER options can be abbreviated to just
- the portions that are show in uppercase.
-
- The Start Drive (/s) option specifies on which drive you
- want LF to start its search. An equals sign (=) and
- the letter of the drive should follow after the option;
- e.g., "lf /s=H filename" would start the search at the
- H: drive). If no "/s" option is given, LF will start at
- whatever drive has been designated as the default start
- drive.
-
- The End Drive (/e) option specifies on which drive
- you would like LF end its search for the file. For example,
- "LF /e=g filename" would end the search on the G: drive.
- If no "/e" option is given, LF will stop its search at
- either the last drive that it can find or at the default
- last drive that is specified in the .EXE, whichever
- comes first. (To use more than one option, separate each
- option with space, e.g., "LF /S=F /E=G filename" will begin
- searching on the F: and end on the G: drive.)
-
- The Only Drive (/o) option specifies the single drive you
- want LF to conduct its search, e.g., "LF /O=H filename."
- This would be equivalent to using the "/s" and "/e"
- options to set the starting and ending drives to the same
- drive. If you use the Writeback (/w) option, both start
- and end drive will be set to the same drive.
-
- The Current Drive (/c) option tells LF to conduct the
- search only on the current drive. This is just a
- shortcut for the /o option if you happen to be on the
- drive you wish to search. If you use the Writeback (/w)
- option to make the Current Drive the default, "lf /w /c"
- is the same as "lf /o=(Current Drive)."
-
- The Attributes "/a" option is used to specify that you want
- LF to find ONLY files with the specified attribute set. The
- format for the command is "/a=[attribute list]" where
- the attribute list may be any combination of the letters
- "SHRA" (in uppercase only). These letters stand for:
-
- S - System
- H - Hidden
- R - Read Only
- A - Archive
-
- These attributes can be written back to the LF.EXE (see
- Writeback option below. When setting the attributes, use
- capital letters. When resetting them, use lower case.
- LF finds Hidden, Read Only, and Archive files as a default.
- This option is used for LIMITING the search, but for
- System files it is necessary to specify (with the /a=S
- option) that you want to find files flagged as System; e.g.,
- "lf /a=S *.sys" tells LF to find the system files with the
- .sys extension. Without the /a=S LF would list all .sys
- except those flagged as system files.
-
- If you use the Interactive (/i) option, LF will display
- the command string that it intends to send to COMSPEC
- followed by a ?, asking for confirmation before executing
- each command string. Pressing Y will cause the command to
- be executed, pressing Q will abort LF, pressing S will
- skip processing on the current subdirectory and
- continue to the next subdirectory in the tree. Pressing C
- (for Continuous) will switch LF into non-interactive mode.
- Pressing any other key will cause LF to skip the command
- on that file and continue looking for the next file. This
- option is to be used when you are executing commands, not
- just searching for a file. If you don't use a command
- string, the /i option will control whether or not LF
- will pause after each screen full of filenames.
-
- The non-interactive option (/y) overrides the interactive
- option. /y will also un-do the interactive option if
- it has been written into LF.EXE file (see the Writeback
- option below).
-
- The OLDER option (/OLDer), will limit the selection to
- files that have not been within the last X number of
- days. The NEWER option (/NEWer), will limit the
- selection to files that have been modified within the
- last X number of days. If LF receives both an OLDER
- and a NEWER command, the OLDER command will be
- ignored.
-
- For example, if today's date is 07/01/91 and you have
- the following files:
-
- OLD.TXT 05/01/91
- NEW.TXT 06/20/91
-
- Then the following command would only find OLD.TXT:
- lf /older=30 *.txt
- and the following would only find TWO.TXT:
- lf /newer=30 *.txt
-
-
- The Writeback (/w) option will write all parameters to the
- LF.EXE file so that they become the defaults. All
- parameters, except /OLDER and /NEWER, can be written
- into the executable. For example, you would
- enter "LF /w /i" to make LF always default to interactive
- mode. Due to the method used to perform this task, the /w
- option probably will not work with DOS versions before
- 3.0.
-
- Command Strings:
- For the [command string] mentioned in the "Syntax"
- statement above to work, you must have specified in
- your autoexec.bat or your network login script where
- the command interpreter (usually command.com) is
- located (this is set in the environment variable
- COMSPEC). For example, you might have
- "set comspec=c:\command.com" in your autoexec.bat.
-
- The [command string] discussed above is a command
- line to be executed on a file once it is found.
- This may be anything that you would normally type from
- the DOS prompt--a DOS command, a program, a batchfile, etc.
-
- If no command string is given, then LF will just
- print the name(s) of the found file(s). LF will also
- show if the file is marked as Read Only or Hidden.
-
- With most commands you do not need to add the path/name of
- the file to the end because LF assumes that you intend the
- command to be done on the filespec searched for. Therefore,
- "LF *.bk! del" means locate all files with the .bk!
- extension and delete them. When a set of characters follows
- the command, however, you need "%s" where the
- path/filename would normally be in that command. For
- example, if you want to find all files with an extension
- of ".txt" and change their dates to 01/17/91, then you would
- enter "LF *.TXT CDATE %s 01/17/91" (CDATE being the name of
- a program that changes the dates of files). For
- clarity, you could still use the "%s" even if the
- filename is to be inserted at the end. So the
- command "LF *.bk! del %s" is the same thing as
- "LF *.bk! del".
-
- If the command you wish to run has command line options
- that are the same as LF, there might be some conflict.
- To prevent this, you can enclose the command string
- in " marks. For example, if you had a command named
- FOO that required a parameter /c and you type:
-
- LF *.txt foo /c
-
- LF will think that you want it to search just the
- current drive (since that is what /c means to LF) and
- it will then NOT pass the /c option onto FOO. To
- execute this command correctly, you should type:
-
- LF *.txt "foo /c"
-
-
- Acceptable Filespecs:
-
- LF accepts any valid file specification; the standard
- DOS wild cards are accepted. If a valid sub-directory
- is specified in the filespec, LF will only search from
- that point down the directory tree.
-
-
- Interacting with LF (Help Screen, Pause, etc.):
-
- Entering "LF" with no parameters will give a short help
- screen which shows the default value for each parameter.
- Parameters that can be ON or OFF will have an * (asterisk)
- by them if they are enabled. The start drive and end
- drive parameters will show the actual values.
-
- While LF is working, you may press the space bar to pause
- it. During this pause, you will also be given a chance to
- abort LF.
-
- Customizing LF to Meet Your Needs (Configuration):
-
- The first thing that you should do with LF is customize
- the default values of start drive and end drive to your
- system. For most PCs, you don't need to do anything since
- LF will start its search at the C: drive and end at Z:
- (or the last disk it can find). If your hard disk(s)
- start somewhere other than C:, you should customize LF
- with a statement which follows this format:
-
- lf /s=X /w (where "X" would be replaced with the letter
- of your starting drive).
-
- If you are using LF on a Novell network, you should set
- both start drive and end drive to the appropriate
- values for your network. If you do not do this, LF
- will probably search the same physical drive several
- times (due to the way Novell sets up the search
- drive mappings).
-
- Examples of LF Commands:
-
- lf *.doc
- - Find all .doc files on the disk system.
-
- lf foo.bar cdate %s 01-17-90
- - Find all files named foo.bar and run CDATE on them
- (CDATE changes the file's time/date stamp date).
- The %s is necessary because the command string includes
- text following the filespec--compare with next example.
-
- lf /s=H /e=L *.txt type %s OR lf /s=H /e=L *.txt type
- - Find all .txt files located in drives H: through
- L: and then execute a DOS type on them. The %s is
- optional because the syntax of the command has no
- additional text after the filespec; therefore, LF
- assumes the filespec to be found is the one to
- receive the action of the DOS command.
-
- lf /o=D *.tmp
- - Find all .tmp files on the D: drive. OR if your
- current drive is D:, you could also type,
- "lf /c *.tmp."
-
- lf /i *.bak del
- - Find all .bak files and ask if each individual file
- should be deleted. With the /i option activated,
- you would be able to enter Y or N to each file prior
- to its deletion. (Note the %s was not needed--
- compare with the second example.)
-
- lf /a=HS *.com
- - Find all .com files that are hidden and system.
-
- lf /a=R *.doc chmod /r
- - Find all .doc files that are Read Only and run
- CHMOD on them to make them not Read Only (see
- Attributes option explained above).
-
- lf /i /w
- - Set up LF so that it always runs in interactive
- mode. (Note: by entering "lf /y /w" you can change
- the default mode back to non-interactive.)
-
- lf /older=90 \transfer\*.* del
- - Find all files in the \transfer sub-directory
- that are 90 old or older and delete them.
-
- CAUTION: The command string can be very powerful or very
- dangerous! I recommend ALWAYS using the "/i" option
- when using a command string that alters files (like del),
- or better yet use the /w option to make LF always work
- in interactive mode.
-
- Remember! The command "lf *.* del" will find every file
- in every drive you have access to and delete them. The
- best way to avoid unintentional alteration of files is to
- write the interactive mode in as a default with the
- command, "lf /i /w."
-
- Disclaimer: The author hereby disclaims all warranties relating to
- this software, whether express or implied, including
- without limitation any implied warranties of
- merchantability or fitness for a particular purpose.
- The author will not be liable for any special,
- incidental, consequential, indirect or similar damages
- due to loss of data or any other reason, even if the
- author or an agent of the author has been advised of
- the possibility of such damages. In no event shall the
- author's liability for any damages ever exceed the
- price paid for the license to use software, regardless
- of the form of the claim. The person using the
- software bears all risk as to the quality and
- performance of the software.
-
- Shareware: LF is distributed as Shareware. You are free to try
- the utility and make copies for others (Copies must
- include this file.) If you continue to use LF,
- however, you are asked to make a donation to the author
- of $15 or more to support continued development of this
- and other software.
-
- Distributors of "Public Domain," "Shareware," and/or
- User Supported software may distribute LF only after
- obtaining written permission from the author.
-
- Please address any comments, suggestions, etc., to:
-
- William Pemberton
- P.O. Box 5754
- Charlottesville, VA 22905
-
- Internet: flash@virginia.edu
-
-