home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / LF32.ZIP / LF.DOC next >
Encoding:
Text File  |  1991-07-10  |  18.3 KB  |  338 lines

  1.  
  2.  
  3.         LF -- LOCATE FILE  (c)1990, 1991 William Pemberton Version 3.2
  4.         --------------------------------------------------------------
  5.         Purpose:  To find a file on a hard disk system or network and to
  6.                   execute a command on the file(s) if needed.  LF is fast!
  7.                   Despite claims of other file search programs, LF proved to
  8.                   be just as fast as the fastest and much faster than other
  9.                   similar programs tested, and LF is NOVELL compatible.
  10.  
  11.         Syntax:   LF [options] filespec [command string]
  12.  
  13.         Remarks:  LF is similar to other file location utilities, except that
  14.                   LF looks across multiple drives (all drives on a hard disk
  15.                   and all drives to which you have access on a network), and 
  16.                   LF also enable you to execute a command on the files that 
  17.                   it locates. In addition, LF shows you the file even if it 
  18.                   is marked hidden or located in a hidden directory.
  19.  
  20.                   LF can be fully configured by the user.  All command line
  21.                   options, except OLDER and NEWER, can be written back to the
  22.                   .EXE so that they then become the default options.
  23.  
  24.                   LF searches for the given filespec (DOS wildcards are
  25.                   accepted) on all the disks beginning with the default
  26.                   or designated start drive.  If a valid sub-directory
  27.                   is specified in the filespec, LF will search from that
  28.                   sub-directory down.  For example, "LF \home\*.txt"
  29.                   would find the files \home\goo.txt, \home\joe\joe.txt,
  30.                   etc.  but not find \temp\lf.txt.
  31.  
  32.        Options:   The [options] mentioned in the "Syntax:" section above 
  33.                   include the following (case is not important):
  34.  
  35.                             /s      - Start Drive
  36.                             /e      - End Drive
  37.                             /o      - Only Drive
  38.                             /c      - Current Drive
  39.                             /i      - Interactive
  40.                             /y      - Not Interactive
  41.                             /a      - Find files with the given attribute(s)
  42.                             /NEWer  - Find files newer then specified
  43.                                       number of days
  44.                             /OLDer  - Find files older then specified
  45.                                       number of days
  46.                             /w      - Writes options back to .EXE
  47.  
  48.                   The OLDER and NEWER options can be abbreviated to just
  49.                   the portions that are show in uppercase.
  50.  
  51.                   The Start Drive (/s) option specifies on which drive you
  52.                   want LF to start its search.  An equals sign (=) and 
  53.                   the letter of the drive should follow after the option; 
  54.                   e.g., "lf /s=H filename" would start the search at the 
  55.                   H: drive). If no "/s" option is given, LF will start at 
  56.                   whatever drive has been designated as the default start 
  57.                   drive.
  58.  
  59.                   The End Drive (/e) option specifies on which drive 
  60.                   you would like LF end its search for the file.  For example,     
  61.                   "LF /e=g filename" would end the search on the G: drive.
  62.                   If no "/e" option is given, LF will stop its search at
  63.                   either the last drive that it can find or at the default 
  64.                   last drive that is specified in the .EXE, whichever 
  65.                   comes first.  (To use more than one option, separate each
  66.                   option with space, e.g., "LF /S=F /E=G filename" will begin
  67.                   searching on the F: and end on the G: drive.)
  68.  
  69.                   The Only Drive (/o) option specifies the single drive you 
  70.                   want LF to conduct its search, e.g., "LF /O=H filename."
  71.                   This would be equivalent to using the "/s" and "/e" 
  72.                   options to set the starting and ending drives to the same 
  73.                   drive.  If you use the Writeback (/w) option, both start 
  74.                   and end drive will be set to the same drive.
  75.  
  76.                   The Current Drive (/c) option tells LF to conduct the
  77.                   search only on the current drive.  This is just a
  78.                   shortcut for the /o option if you happen to be on the 
  79.                   drive you wish to search.  If you use the Writeback (/w)
  80.                   option to make the Current Drive the default, "lf /w /c"
  81.                   is the same as "lf /o=(Current Drive)."
  82.  
  83.                   The Attributes "/a" option is used to specify that you want 
  84.                   LF to find ONLY files with the specified attribute set.  The
  85.                   format for the command is "/a=[attribute list]" where
  86.                   the attribute list may be any combination of the letters
  87.                   "SHRA" (in uppercase only).  These letters stand for:
  88.  
  89.                                 S - System
  90.                                 H - Hidden
  91.                                 R - Read Only
  92.                                 A - Archive
  93.  
  94.                   These attributes can be written back to the LF.EXE (see
  95.                   Writeback option below.  When setting the attributes, use
  96.                   capital letters.  When resetting them, use lower case.
  97.                   LF finds Hidden, Read Only, and Archive files as a default.
  98.                   This option is used for LIMITING the search, but for
  99.                   System files it is necessary to specify (with the /a=S 
  100.                   option) that you want to find files flagged as System; e.g., 
  101.                   "lf /a=S *.sys" tells LF to find the system files with the
  102.                   .sys extension.  Without the /a=S LF would list all .sys
  103.                   except those flagged as system files.
  104.                     
  105.                   If you use the Interactive (/i) option, LF will display 
  106.                   the command string that it intends to send to COMSPEC 
  107.                   followed by a ?, asking for confirmation before executing
  108.                   each command string.  Pressing Y will cause the command to 
  109.                   be executed, pressing Q will abort LF, pressing S will 
  110.                   skip processing on the current subdirectory and
  111.                   continue to the next subdirectory in the tree.  Pressing C
  112.                   (for Continuous) will switch LF into non-interactive mode.
  113.                   Pressing any other key will cause LF to skip the command
  114.                   on that file and continue looking for the next file. This
  115.                   option is to be used when you are executing commands, not
  116.                   just searching for a file.  If you don't use a command
  117.                   string, the /i option will control whether or not LF
  118.                   will pause after each screen full of filenames.
  119.  
  120.                   The non-interactive option (/y) overrides the interactive
  121.                   option.  /y will also un-do the interactive option if
  122.                   it has been written into LF.EXE file (see the Writeback
  123.                   option below).
  124.  
  125.                   The OLDER option (/OLDer), will limit the selection to
  126.                   files that have not been within the last X number of
  127.                   days.  The NEWER option (/NEWer), will limit the
  128.                   selection to files that have been modified within the
  129.                   last X number of days.  If LF receives both an OLDER
  130.                   and a NEWER command, the OLDER command will be
  131.                   ignored.
  132.  
  133.                   For example, if today's date is 07/01/91 and you have
  134.                   the following files:
  135.  
  136.                         OLD.TXT         05/01/91
  137.                         NEW.TXT         06/20/91
  138.  
  139.                   Then the following command would only find OLD.TXT:
  140.                         lf /older=30 *.txt
  141.                   and the following would only find TWO.TXT:
  142.                         lf /newer=30 *.txt
  143.  
  144.  
  145.                   The Writeback (/w) option will write all parameters to the 
  146.                   LF.EXE file so that they become the defaults.  All
  147.                   parameters, except /OLDER and /NEWER, can be written
  148.                   into the executable.  For example, you would
  149.                   enter "LF /w /i" to make LF always default to interactive
  150.                   mode.  Due to the method used to perform this task, the /w
  151.                   option probably will not work with DOS versions before
  152.                   3.0.
  153.  
  154. Command Strings:
  155.                   For the [command string] mentioned in the "Syntax" 
  156.                   statement above to work, you must have specified in
  157.                   your autoexec.bat or your network login script where
  158.                   the command interpreter (usually command.com) is
  159.                   located (this is set in the environment variable
  160.                   COMSPEC).  For example, you might have
  161.                   "set comspec=c:\command.com" in your autoexec.bat.
  162.  
  163.                   The [command string] discussed above is a command 
  164.                   line to be executed on a file once it is found. 
  165.                   This may be anything that you would normally type from 
  166.                   the DOS prompt--a DOS command, a program, a batchfile, etc.
  167.                     
  168.                   If no command string is given, then LF will just
  169.                   print the name(s) of the found file(s).  LF will also
  170.                   show if the file is marked as Read Only or Hidden.
  171.  
  172.                   With most commands you do not need to add the path/name of 
  173.                   the file to the end because LF assumes that you intend the
  174.                   command to be done on the filespec searched for.  Therefore,
  175.                   "LF *.bk! del" means locate all files with the .bk! 
  176.                   extension and delete them.  When a set of characters follows 
  177.                   the command, however, you need "%s" where the
  178.                   path/filename would normally be in that command.  For 
  179.                   example, if you want to find all files with an extension
  180.                   of ".txt" and change their dates to 01/17/91, then you would
  181.                   enter "LF *.TXT CDATE %s 01/17/91" (CDATE being the name of
  182.                   a program that changes the dates of files).  For
  183.                   clarity, you could still use the "%s" even if the
  184.                   filename is to be inserted at the end.  So the
  185.                   command "LF *.bk! del %s" is the same thing as
  186.                   "LF *.bk! del".
  187.  
  188.                   If the command you wish to run has command line options
  189.                   that are the same as LF, there might be some conflict.
  190.                   To prevent this, you can enclose the command string
  191.                   in " marks.  For example, if you had a command named
  192.                   FOO that required a parameter /c and you type:
  193.  
  194.                   LF *.txt foo /c
  195.  
  196.                   LF will think that you want it to search just the
  197.                   current drive (since that is what /c means to LF) and
  198.                   it will then NOT pass the /c option onto FOO.  To
  199.                   execute this command correctly, you should type:
  200.  
  201.                   LF *.txt "foo /c"
  202.  
  203.  
  204. Acceptable Filespecs:
  205.  
  206.                   LF accepts any valid file specification; the standard
  207.                   DOS wild cards are accepted.  If a valid sub-directory
  208.                   is specified in the filespec, LF will only search from
  209.                   that point down the directory tree.
  210.  
  211.  
  212. Interacting with LF (Help Screen, Pause, etc.):
  213.  
  214.                   Entering "LF" with no parameters will give a short help
  215.                   screen which shows the default value for each parameter. 
  216.                   Parameters that can be ON or OFF will have an * (asterisk)
  217.                   by them if they are enabled.  The start drive and end 
  218.                   drive parameters will show the actual values.
  219.  
  220.                   While LF is working, you may press the space bar to pause
  221.                   it.  During this pause, you will also be given a chance to 
  222.                   abort LF.
  223.  
  224. Customizing LF to Meet Your Needs (Configuration):
  225.  
  226.                   The first thing that you should do with LF is customize
  227.                   the default values of start drive and end drive to your
  228.                   system.  For most PCs, you don't need to do anything since
  229.                   LF will start its search at the C: drive and end at Z:
  230.                   (or the last disk it can find).  If your hard disk(s) 
  231.                   start somewhere other than C:, you should customize LF 
  232.                   with a statement which follows this format:
  233.                     
  234.                       lf /s=X /w (where "X" would be replaced with the letter
  235.                       of your starting drive).
  236.  
  237.                   If you are using LF on a Novell network, you should set
  238.                   both start drive and end drive to the appropriate
  239.                   values for your network.  If you do not do this, LF
  240.                   will probably search the same physical drive several
  241.                   times (due to the way Novell sets up the search
  242.                   drive mappings).
  243.  
  244. Examples of LF Commands:
  245.  
  246.                   lf *.doc
  247.                      - Find all .doc files on the disk system.
  248.  
  249.                   lf foo.bar cdate %s 01-17-90
  250.                      - Find all files named foo.bar and run CDATE on them 
  251.                        (CDATE changes the file's time/date stamp date). 
  252.                        The %s is necessary because the command string includes 
  253.                        text following the filespec--compare with next example.
  254.  
  255.                   lf /s=H /e=L *.txt type %s  OR  lf /s=H /e=L *.txt type
  256.                      - Find all .txt files located in drives H: through
  257.                        L: and then execute a DOS type on them.  The %s is
  258.                        optional because the syntax of the command has no
  259.                        additional text after the filespec; therefore, LF 
  260.                        assumes the filespec to be found is the one to
  261.                        receive the action of the DOS command.
  262.  
  263.                   lf /o=D *.tmp
  264.                      - Find all .tmp files on the D: drive.  OR if your
  265.                        current  drive is D:, you could also type,
  266.                        "lf /c *.tmp."
  267.  
  268.                   lf /i *.bak del
  269.                      - Find all .bak files and ask if each individual file
  270.                        should be deleted.  With the /i option activated,
  271.                        you would be able to enter Y or N to each file prior
  272.                        to its deletion.  (Note the %s was not needed--
  273.                        compare with the second example.)
  274.                          
  275.                   lf /a=HS *.com
  276.                      - Find all .com files that are hidden and system.
  277.  
  278.                   lf /a=R *.doc chmod /r
  279.                      - Find all .doc files that are Read Only and run
  280.                        CHMOD on them to make them not Read Only (see 
  281.                        Attributes option explained above).
  282.  
  283.                   lf /i /w
  284.                      - Set up LF so that it always runs in interactive
  285.                        mode.  (Note: by entering "lf /y /w" you can change 
  286.                        the default mode back to non-interactive.)
  287.  
  288.                   lf /older=90 \transfer\*.* del
  289.                      - Find all files in the \transfer sub-directory
  290.                        that are 90 old or older and delete them.
  291.  
  292.      CAUTION:     The command string can be very powerful or very
  293.                   dangerous!  I recommend ALWAYS using the "/i" option
  294.                   when using a command string that alters files (like del), 
  295.                   or better yet use the /w option to make LF always work
  296.                   in interactive mode.
  297.  
  298.                   Remember!  The command "lf *.* del" will find every file
  299.                   in every drive you have access to and delete them.  The 
  300.                   best way to avoid unintentional alteration of files is to
  301.                   write the interactive mode in as a default with the 
  302.                   command, "lf /i /w."
  303.  
  304.        Disclaimer:  The author hereby disclaims all warranties relating to
  305.                     this software, whether express or implied, including
  306.                     without limitation any implied warranties of
  307.                     merchantability or fitness for a particular purpose.
  308.                     The author will not be liable for any special,
  309.                     incidental, consequential, indirect or similar damages
  310.                     due to loss of data or any other reason, even if the
  311.                     author or an agent of the author has been advised of
  312.                     the possibility of such damages.  In no event shall the
  313.                     author's liability for any damages ever exceed the
  314.                     price paid for the license to use software, regardless
  315.                     of the form of the claim.  The person using the
  316.                     software bears all risk as to the quality and
  317.                     performance of the software. 
  318.  
  319.        Shareware:   LF is distributed as Shareware.  You are free to try
  320.                     the utility and make copies for others (Copies must
  321.                     include this file.)  If you continue to use LF,
  322.                     however, you are asked to make a donation to the author
  323.                     of $15 or more to support continued development of this
  324.                     and other software.
  325.  
  326.                     Distributors of "Public Domain," "Shareware," and/or
  327.                     User Supported software may distribute LF only after
  328.                     obtaining written permission from the author.
  329.  
  330.                     Please address any comments, suggestions, etc., to:
  331.                           
  332.                               William Pemberton
  333.                               P.O. Box 5754 
  334.                               Charlottesville, VA 22905
  335.                               
  336.                     Internet: flash@virginia.edu
  337.  
  338.