From: @arrakis.denver.co.us (Bob Hood)
Newsgroups: comp.lang.c
Subject: Directory search function needed
Date: 4 Jan 93 08:55:58 GMT
Reply-To: thor@arrakis.denver.co.us
Organization: Bob's Programming Paradise

In article <8829@orbit.cts.com> ceg@pnet51.orb.mn.org writes:
>
> Does anyone out there have a function that will search DOS directories
> for a specific file (or a wildcard x*.* of files)?  Thanks!
>

I have a utility that I wrote for myself called "Locate File", or LF for short.
This utility is a power-user's WHEREIS.  Here's the help screen from it:

    Locate File 1.93  ~  Copyright (C) 1992 Bob Hood

    Usage: LF [option [option]...] <filespec1> [<filespec2>...<filespec10>]
    where [option] is one or more of the following:
    -q      quite mode: only located files are printed w/ full path
    -l      look mode: scans located binary/ascii files for text
                filespec1 is the text to search for
                filespec2-10 are normal file specifications
    -r[d]       restricts search to current partition
                'd' current directory and subdirectories
    -k[vudf]    kills every matched file
                'v' verify kills
                'u' make deleted files unrecoverable
                'd' remove empty directories
                'f' forcibly removes files (READONLY)
    -c<command> applies <command> to every file located
                (see LF.DOC for details and examples of usage)
    -d[XX]99/99/99  specifies a date to match, where XX is one of:
                 +  after <date>
                 -  before <date>
                +=  after or equal to <date>
                -=  before or equal to <date>
    -t[XX]99:99 specifies a time to match, where XX is one of:
                 +  after <time>
                 -  before <time>
                +=  after or equal to <time>
                -=  before or equal to <time>
    -a[RHSVAD]  display attributes of located files, or locate files
            with one or more of these attributes:
                'R' read-only
                'H' hidden
                'S' system
                'V' volume label
                'A' archive
                'D' directory
    -p      restrict search to the currently defined PATH variable
    <filespec>  any valid DOS filename specification (unless otherwise noted)


This utility will, by default, search multiple partitions, unlike Norton's FF.

Since the source is over 1,000 lines of code, I will email to anyone who 
wishes a copy a uuencoded archive containing the source code, MS-DOS 
executable, and the DOC file for the utility. Please indicate the archive 
format you would like (ARJ, ZIP, LZH, ZOO, etc.).

Please Note:  I have not before released the source code to this program.  
Although it is copyrighted, I will release it for free and unrestricted 
personal use.  Also, since I wrote this utility for myself, and since you will 
have the source in your hot little hands, please keep any requests for support 
to a minimum.

Bob
---
Bob Hood   thor@arrakis.denver.co.us      H: 303-986-7127   W: 303-623-2180
-----------------------------------------------------------------------------
                  I'm not an expert, but I play one at work....
Newsgroups: comp.lang.c