home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- ---------------------------------
- SNiF - The ultimate file-finder
- Version 1.34
- Copyright (c)1992
- Written by Carl Declerck
- ----------------------------------
-
-
-
-
-
-
-
-
-
-
- Introduction
- ------------
-
- SNiF is a program that allows you to find files across one or more harddisks
- (floppies). It is operated from the DOS command line and offers many options
- which may affect the 'sniffing' (searching) of files.
-
- SNiF uses a method called Dynamic Parameter Parsing (DPP) to give the user
- optimum sniffing performance. This means that options may be dynamically set
- from command-parameter to command-parameter, thus affecting only those actual
- parameters in between!
-
- You will find that SNiF adapts itself automagically to your personal knowledge
- and experience in using the program. SNiF is as easy to operate as the DOS
- "dir" command. On the other hand, it is so powerful and versatile that a BBS
- sysop can do his complete daily maintenance under SNiF's control and
- supervision. Its uses and possibilities are unlimited!
-
-
- Running SNiF
- ------------
-
- To start SNiF, you just type its name at the DOS prompt. When no parameters or
- options are given, SNiF will display some cryptic information on the options
- provided and their default values.
- The parameters which can be passed to SNiF are file-masks and options. File-
- masks are strings such as: *.BBS, BIMOD???.DOC, WIN.*, etc... any valid DOS
- wildcarded name. Options are strings such as: +d, -f, "+xdir &p&m", etc...
-
-
- Options provided
- ----------------
-
- +aHSRA, -a
-
- Allows you to specify an attribute mask. Only files that have these attrs
- will be sniffed. Option -a disables attribute sniffing, it has the same
- effect as +aHSRA (ie. all attrs on). Valid attribute-identifiers are:
- H (Hidden), S (System), R (Read-only) and A (Archive). Any of these
- identifiers may be combined to make up the sniffing attribute mask. The
- order is of no importance.
- The default is -a.
-
- +bSTRING, -b
-
- This option is only useful when using a logfile (see further). It allows
- you to put in a commentline with the value of STRING. Note that when the
- +b option is set, all logged pathnames of files sniffed will be indented
- by 3 spaces, giving a neater layout. Option -b disables this indentation.
- Note that when STRING equals "INFO", additional file-info will be logged
- with each pathname.
- The default is -b.
-
- +c, +c1, -c
-
- Tells SNiF to ask for confirmations before executing a given command, or
- not. When just +c is used, SNiF will ask the user whether it should
- execute the specified +x command. Alternatively, when +c1 is used, SNiF
- displays the currently found file and prompts for a command to be entered.
- This command is subject to substitution just like the +xSTRING commands.
- The default is -c.
-
- +d, -d
-
- This option allows you to tell SNiF whether it should display the full
- pathname of any file that matches the given file-mask(s), or not.
- The default is +d.
-
- +e, -e
-
- Enables or disables the escape key whilst sniffing.
- The default is +e.
-
- +f, +f1, -f
-
- This option allows you to tell SNiF whether it should stop searching through
- the directories when a file matching the specified file-mask(s) is found.
- The +f option tells SNiF it should skip to the next directory when a
- matching file is found, the +f1 option tells SNiF it should stop sniffing
- immediately. The -f option tells SNiF it should just continue sniffing when
- matching files are found.
- The default is -f.
-
- +gSTRING, -g
-
- Allows you to snif for files that contain the STRING sequence of
- characters. This option is cumulative, this means you can specify multiple
- search-strings with multiple instances of +g.
- By default, searching for a STRING is case-insensitive. To make it case-
- sensitive, you precede STRING by a '!'. It is also possible to insert
- non-keyboard characters by giving their ASCII value in 2-digit hex-from,
- preceded by a backslash (ie. \XX). To escape the backslash itself, you
- simply use '\\'.
- Option -g clears ALL search-strings.
- The default is -g.
-
- +iSTRING, -i
-
- Tells SNiF to take subsequent options from a control file. STRING is the
- name of the control file to be used, it defaults to SNIF.CTL. When a +i
- option is issued SNiF will open the control file and use its contents as
- if they were passed as parameters on the command-line. When SNiF reaches
- the end of the control file, it just continues taking its parameters from
- the real command-line! This option is particularly useful for passing on
- variable lists of filemasks that should be sniffed for. The -i option may
- be used inside a control file to stop SNiF taking options from it.
- The default is -i.
-
- +kSTRING, -k
-
- This one allows you to specify a 'C-like' format-string for the logfile
- output. For each file sniffed this string will be logged, subject to the
- following substitutions:
-
- &f full pathname (incl. filename) of the file sniffed
- &p pathname only of file sniffed
- &n filename only of file sniffed
- &m currently active filemask
- &t sniffed file's creation time
- &d sniffed file's creation date
- &a sniffed file's attributes
- &s sniffed file's size in bytes
-
- It is also allowed to include hex-entries (\XX) in the format-string, like-
- wise to the +g option.
- The +k option is one of the more advanced features of SNiF... so for normal,
- standard logfile-info one might rather use the simpler +bINFO (or -bINFO)
- option! Option -k disables the format-string.
- The default is -k.
-
- +lSTRING, -l
-
- Tells SNiF whether it should log the full pathname of each matching file,
- or not. STRING is the name of the logfile to be used, if it doesn't exist,
- it is created, if it exists already, it is appended to. When the +l option
- is used with STRING omitted, STRING defaults to SNIF.LOG. However, if a
- +lSTRING option has been turned off with -l, and is later re-activited with
- just +l, the old value of STRING will be re-used!
- The default is -l.
-
- +m, +m1, +m2, -m
-
- This option is an _extremely_ powerful one; it allows you to build advanced
- exceptions using any criteria that SNiF supports (ie. not only filemasks,
- as +n option). Advanced exceptions are built just as you would build a set
- of criteria for normal sniffing, ie. you just specify the criteria which
- make up the advanced exception using the normal options...
- To start building advanced exceptions, issue the +m command. Any criteria
- or filemasks following this +m will be added to the advanced exception
- list.
- When the advanced exception list is built, and you want to activate it,
- issue the +m1 command and subsequently specify the criteria and filemasks
- you wish to snif for.
- For example: we wish to snif all files on the current drive, except all
- hidden .SYS files. This could be done with something like:
-
- SNiF +m +aH *.sys +m1 -a *.*
-
- We first turn on advanced exception building with +m, then specify the
- criterion for hidden-attribute sniffing and the *.sys filemask. Note that
- after having turned off building of advanced exceptions with +m1 (thus also
- activating it!), we still need to specify -a because we want to snif every
- file on the drive, not only the hidden ones! It is important to note that a
- +m1 instance does NOT turn off any criteria activated for advanced
- exceptions, we must do so separately!
- The +m2 option is similar to +m1, except that it also sets the Hidden
- attribute of all files in the advanced exception list. This may be useful
- when calling programs/commands that are passed wildcard parameters.
- When SNiF terminates or -m is issued, all +m2 Hidden files are restored to
- their original attribute.
- To disable advanced exceptions, -m must be issued.
- The default is -m.
-
- +nMASK, -n
-
- This option is a power-option of SNiF! It allows you to make exceptions in
- the files which should be sniffed for. MASK must be a valid wildcard. Any
- files that match the MASK wildcard will be ignored by SNiF. The +n options
- may be repeated to specify multiple MASKs. Note that MASKs should NOT
- include paths! If you want to have exceptions on paths as well, you should
- use advanced exceptions (option +m).
- The -n option turns ALL exceptions off.
- The default is -n.
-
- +o, -o
-
- Tells SNiF whether to use logical ORs or ANDs when dealing with each
- criterion list. Option +o will cause all criteria in the following
- criterion-instances to be OR'ed to make up the end-result for that
- criterion list (the OR is implicit). The -o option causes all criteria to
- be AND'ed. For example:
-
- SNiF +o +gbilbo +gbaggins *.txt
-
- will show all .TXT files containing the case-insensitive strings "Bilbo"
- OR "Baggins". Whereas
-
- SNiF -o +gbilbo +gbaggins *.txt
-
- would show only those .TXT files containing both "Bilbo" AND "Baggins".
- The default is +o.
-
- +r, -r
-
- Tells SNiF whether it should snif directories recursively or not.
- The default is +r.
-
- +s, -s
-
- The +s option tells SNiF to display some statistics on the actions it per-
- formed up 'till now. The -s option makes SNiF forget about all previously
- performed actions.
- The default is -s.
-
- +tSTRING, -t
-
- Allows you to specify an indefinite number of file creation-time criteria.
- Like +n, multiple criteria may be specified with multiple instances of +t.
- SNiF can handle two types of time criteria: absolute and relative ones.
- Absolute criteria are of the form: Thh:mm:ss where T is either E (equal
- to), B (before) or A (after), and hh:mm:ss is a time in
- hours:minutes:seconds, two digits per time-element MUST be given. So,
- option +tA20:12:16 means only files created after 20:12:16 will be sniffed.
- Relative criteria are of the form: Tnnnnn where T is either X (exactly),
- O (older than) or Y (younger than), and nnnnn is a number of minutes in
- decimal. So +tX45 means only snif files that are exactly 45 mins old.
- Option -t clears ALL stacked time-criteria.
- The default is -t.
-
- +uSTRING, -u
-
- Allows you to specify an indefinite number of file creation-date criteria.
- Like +n, multiple criteria may be specified with multiple instances of +u.
- SNiF can handle two types of date criteria: absolute and relative ones.
- Absolute criteria are of the form: Ddd/mm/yy where D is either E (equal
- to), B (before) or A (after), and dd/mm/yy is a date as day/month/year, two
- digits per date-element MUST be given. So, option +uB14/09/90 means only
- files created before 14th of september 1990 will be sniffed.
- Relative criteria are of the form: Dnnnn where D is either X (exactly),
- O (older than) or Y (younger than), and nnnn is a number of days in
- decimal. So +uO5 means only snif files that are (more than) 5 days old.
- SNiF also supports the American date-format, month-day-year. To use it
- instead of European format, dashes must be used to separate the date-
- elements. Ie: mm-dd-yy.
- Option -u clears ALL stacked date-criteria.
- The default is -u.
-
- +wXY, -w
-
- This option tells SNiF whether it should snif the whole system, or just the
- specified paths. If just +w is used, SNiF will search the whole currently
- selected drive. However, you can set the starting and ending drive
- (including floppies) by adding them to the +w option: The first letter
- corresponds to the first drive in the 'snif-range', the second letter
- corresponds to the last drive. If only a single letter is specified, it
- will correspond to the first drive. A special drive-letter is supported
- through the '@' character, it denotes the current drive.
- The default is +w@@. Any paths preceding filemasks override this default.
-
- +xSTRING, -x
-
- This is another power-option of SNiF: it allows you to tell it which
- DOS commands/programs it should execute when a file matches the given
- file-mask. Multiple commands/programs may be specified using multiple
- instances of +x. The commands/programs will be executed in the order they
- are given at the command-line (or in the control-file).
- Because DOS uses the SPACE character to separate its command-line into
- parameters, it may be necessary to surround the +x option with
- double-quotes " or square-brackets [ and ] when this contains any spaces.
- This will cause DOS to see it as a single parameter. The following
- character-sequences will be replaced by runtime-values when they are found
- in STRING and when a matching file is found:
-
- &f replaced by the full pathname of a matching file
- &n replaced by the filename (w/o extension) of a matching file
- &x replaced by the extension of a matching file's filename
- &p replaced by the path which a matching file resides in
- &m replaced by the currently active file-mask
-
- The -x option clears ALL stacked commands/programs.
- The default is -x.
-
- +zSTRING, -z
-
- This option allows you to set a filesize criterion. An unlimited number of
- filesize criteria may be set (memory-permitting, of course) by specifying
- multiple instances of the +z option (analogous to +n option). Only files
- whose filesize conforms to at least one of the criteria are sniffed.
- The value of STRING must be of the form "Onnnnnnn", where O is either
- E (equal to), L (less than) or G (greater than), and where nnnnnnn is the
- number of bytes to compare the filesize with (decimal).
- The -z option clears ALL stacked filesize criteria.
- The default is -z.
-
-
- Using SNiF
- ----------
-
- When using SNiF, the user should know that the parameters are parsed
- dynamically, this means that all the various options can be turned on and off
- on the same command-line!
-
- For example, "SNiF +f1 *.exe -f *.com" will only snif for the first .EXE file
- to be found, but will snif for all .COM files.
-
- SNiF will exit with errorlevel 1 when at least one file was sniffed, otherwise
- it'll exit with errorlevel 0.
-
-
- Using control files to drive SNiF
- ---------------------------------
-
- With the +i option, you can instruct SNiF to take its options/parameters from
- a specified control file.
- Such a control file is plain vanilla ASCII text and can be created with your
- favourite text-editor. Lines in these control files may contain:
-
- - options, as at the command-line (ONE option per line!!!)
- - filemasks (preceded by paths) (ONE filemask per line!!!)
- - comments, preceded by a semi-colon ';'
- - nothing, ie: blank lines
-
- Note that it is no longer necessary to use quotes " or square brackets [ and ]
- to delimit strings inside control files. This restriction only applies to the
- command-line and the SNIF environment variable (see below).
-
- When the end of a control file is reached (when all options and parameters in
- it have been parsed/executed), SNiF will again continue to take options from
- the command-line.
-
-
- The SNiF environment variable
- -----------------------------
-
- You can set up a DOS-environment variable called SNIF which will be parsed in
- the same way as the command-line or control files when SNiF starts up.
- This allows you to customize SNiF to your particular system needs. For example,
- you may want to set a different default sniffing range with +w, or change the
- default logfile-format using +k. Or you could even use +i to run 'default'
- control files. Anything is allowed!
-
-
- Some examples
- -------------
-
- a) SNiF -d +f +wBF "+xdel &p&m" *.tmp
-
- Deletes all .TMP files on drives B: through F:.
-
- b) SNiF e:\windows\*.ini -r e:\*.com
-
- Shows all .INI files on drive E:, starting from directory \WINDOWS.
- Shows all .COM files in the root (only!) of drive E:.
-
- c) SNiF -d "+xcopy &f c:\backup\&n.bak" d:\tcpp\*.c +s
-
- Copies all .C files starting from drive D:'s \TCPP directory to drive C:'s
- \BACKUP directory, but with extension .BAK.
- Gives statistics on all performed copies.
-
- d) SNiF -d +w +nnot_this.txt "+xtype &f" *.txt
-
- Will type every .TXT file to be found on your system to the screen, except
- the NOT_THIS.TXT file!
-
- e) SNiF -d +wE +lgiflog.txt "+bList of GIF files:" *.gif -b +i
-
- Makes a logfile called GIFLOG.TXT of all GIF files, starting from drive E:,
- with logfile comment "List of GIF files:".
- Afterwards, it'll take subsequent options from SNIF.CTL.
-
- f) SNiF +n*.lzh +n*.zip +n*.arc -d "+xdel &f" e:\temp\*.*
-
- This will delete all non- .LZH .ZIP .ARC files on drive E:, starting from
- directory \TEMP.
-
- g) SNiF +w +aHS *.* -a "+xdel &f" +zE0 *.* +l -x -z +zG1000000 *.*
-
- Lists all Hidden System files, then deletes all 0-length files and
- finally logs all files which are over 1 meg in size.
-
- h) SNiF +m +zE0 *.* +m1 -z *.*
-
- Lists all non-0 length files on the current drive.
-
-
- Disclaimer
- ----------
-
- You use SNiF at your own risk! I will not be held responsible for any possible
- loss of data or damage, caused to your system through the use of SNiF.
- You should be fully aware of the fact that SNiF can perform very powerful, yet
- extremely radical tasks! Forgetting to turn off a +xdel option may well be the
- cause of many a sleepless night, just to name an example.
-
-
- Limitations
- -----------
-
- SNiF has been written to make the best use of available memory. However, as it
- is a kind of program that is expected to be fast, it is limited to 64Kb of
- work-space, ie. one data-segment in standard DOS. Therefore most strings used
- in SNiF have a limit of 128 or 256 bytes. This should be sufficient for most
- tasks you want it to do, but if you get a 'Memory allocation failed' error,
- you should write to one of the addresses listed below and I may recompile a
- version for a larger memory-model. This larger version will be slower though!
-
-
- Comments
- --------
-
- SNiF is a freeware program, which means you copy and share it freely, as long
- as the program-code and this documentation is not modified.
- The program and docs were written by Carl Declerck, Copyright (c)1991-1992.
-
- Special thanx go to:
-
- Jan Meeremans. Beta-testing and bug-reports.
- Christophe David. Beta-testing, bug-reports and responsible for many of
- the great ideas behind SNiF's various features.
-
- Any supporting remarks or bug reports may be directed to the addresses listed
- below:
-
- Snail : Vrijgeweidestraat 24, 2800 Mechelen, Belgium (Voice: +32-15-432064)
-
- Netmail : 2:292/500.21510@fidonet.org
-
-
- Hope you enjoy using the program!
-
- The author, Carl Declerck.
-
-