home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
BBS
/
SFDFC10.ZIP
/
SFDFC.DOC
< prev
next >
Wrap
Text File
|
1994-12-09
|
8KB
|
183 lines
╔════════════════════════════════════════╗
║ ║
║ ╓─┐ ╥──┐ ╥──┐ ╥──┐ ╓──┐ ║
║ ╙─┐ ╟─ ║ │ ╟─ ║ ║
║ ╙──┘ ╨ ╨──┘ ╨ ╙──┘ ║
║ v1.0 ║
║ SPITFIRE DUPLICATE FILE CHECKER ║
║ ║
║ Copyright By Richard Lemaster ║
║ Over The Line BBS ║
║ (918) 250-0542 ║
║ ║
╚════════════════════════════════════════╝
INTRODUCTION
────────────
SFDFC, SPITFIRE Duplicate File Checker, is a utility written to be used
by Sysops operating a SPITFITE BBS system. SFDFC will build a database
of all files which are available for download on the BBS. Then, using this
database, SFDFC can test whether a file which is uploaded to the BBS is a
duplicate of an existing file. When a duplication is detected, SFDFC returns
an errorlevel of 1. If no duplication is found, SFDFC returns an errorlevel
of 0. These return codes are significant in that they can be used in batch
files to determine what processing steps should be executed based on the
errorlevel which is returned. Ideally, this would be done in the CHKUP.BAT
used in conjunction with Buffalo Creek Software's SFCHKUP utility.
SFDFC conveniently allows the database to be expanded as files are added
to the BBS. This can be done as individual files are uploaded to the BBS.
Or, file names can be added to the database from a file listing, such as a
CD Rom file list when CD Roms are added to the BBS.
Another important feature of SFDFC, is its ability to create a text
file of all duplicate files already in existance in the BBS. The Sysop can
use this list to locate and remove duplicate files which waste precious disk
space.
COMMAND LINE PARAMETERS
───────────────────────
SFDFC has several command line parameters which specify the action which
SFDFC performs. These include:
SFDFC - executed without any command line parameters will display the command
line parameters which are valid for SFDFC.
SFDFC MAKEFILE - reads SPITFIRE's SFFAREA.DAT to create a database (SFDFC.DAT)
of all files which are available from the SPITFIRE file areas. When
using the MAKEFILE command line parameter, SFDFC must be executed from
the SPITFIRE home directory. If executed from another directory, the
error message SFFAREA.DAT not found in the current directory is
displayed.
SFDFC ADDLIST <list name> - reads the file list and adds each file in the
list to the SFDFC.DAT file. If no <list name> is included, or if the
<list name> can not be found, SFDFC will display the error message
notifying you that <list name> was not found.
SFDFC ADDFILE <file name> - will add <file name> to the database of files
available for download from the BBS. If the <file name> is omitted
from the command line, an error message is diplayed which informs you
the file name was not included with the command. <file name> may be
the file name and extension (SFDFC.ZIP) or can include the entire
drive, directory, file name and extension information,
(C:\SF\UPLOADS\SFDFC.ZIP).
SFDFC <file name> - SFDFC will check to see if the <file name> exists in
the SFDFC.DAT file. If <file name> is found in the data file,
SFDFC.DAT, SFDFC returns an errorlevel of 1 to indicate this file is
a duplicate of an existing file. If <file name> is not found in the
datafile, SFDFC returns and errorlevel of 0.
The CHECKDUPE parameter can be added to any of the above command lines.
When CHECKDUPE is added, SFDFC will perform the functions appropriate for
the command line parameter which is being used and also create a text file
(DUPES.TXT) whichs lists any file duplication. If the file DUPES.TXT
already exists, SFDFC will append the duplicate file information to the
existing DUPES.TXT. It should be noted the CHECKDUPE is an optional
parameter and may require some time to do the required duplicate checking.
But it is also important to note that the CHECKDUPE option should in
most instances only need to be performed once.
Sysops should also be aware that the SET SFDFC statement can be used
to define the directory where the required SFDFC files reside. To use the
SET statement to define the environment variable for SFDFC, the following
command should be placed in the AUTOEXEC.BAT:
SET SFDFC=C:\SF
where C:\SF would be replaced with the path to where the SFDFC files reside.
If SFDFC is unable to locate the path were the required files reside from
the above defined environment variable, it will default to using the
directory from which SFDFC is executed.
SAMPLE CHKUP.BAT COMMANDS
─────────────────────────
SFDFC may be used from the DOS command prompt or from within a batch
file. Ideally, SFDFC will be used from DOS to build the inital database
and/or duplicate file lists.
After creating the SFDFC.DAT, it is highly recommended that SFDFC be
included as part of your CHKUP.BAT so that when SFCHKUP processes uploaded
files, it will check the upload to determine if it duplicates an existing
file. The following commands should be placed at the beginning of your
CHKUP.BAT:
REM Check For File Duplication
SFDFC %1%2
IF ERRORLEVEL 1 GOTO DUPFILE
SFDFC ADDFILE %1%2
:DUPFILE
ECHO CALLER'S UPLOAD DUPLICATES EXISTING FILE >> C:\SF\WORK\CALLERS.LOG
DEL \CHKUP\%1%2
GOTO END
:END
CD\SF
It is appropriate at this time to explain the processing sequence which
is used above. SFCHKUP passes the <file name> to the CHKUP.BAT and thus,
SFDFC %1%2 is in essence using the command line parameter SFDFC <file name>.
If SFDFC returns an errorlevel of 0, the uploaded file is not a duplicate.
When an errorlevel of 0 is returned, the SFDFC ADDFILE %1%2 will add the
uploaded file to the database, SFDFC.DAT.
(At this point in the CHKUP.BAT, commands would be included which
the Sysop uses to test the integrity of the file, perform virus
scans, convert to a specific archive format, add comments, etc.
These commands are not included in the above example but sample
CHKUP.BAT files are available from Buffalo Creek's BBS and within
SFCHKUP.ZIP.)
If SFDFC returns an errorlevel of 1, the uploaded file duplicates a
file which already exists on the BBS. When this happens, the batch file
is instructed to go to the :DUPFILE label. The :DUPFILE merely logs
an entry to the caller's log that the upload was a duplicate and erases
the file from the upload directory. (When the file is erased from the
upload directory, SFCHKUP removes any upload credits from the caller.)
After erasing the uploaded file, the batch file is instructed to go to
the :END label, which in this example simply changes to the SPITFIRE
directory before terminating and returning control back to SPITFIRE.
DISCLAIMER
──────────
Use this program at your own risk. There are no guarantees that SFDFC
will run on your system. Richard Lemaster shall not be held responsible
for any damages incurred while running SFDFC. The user accepts all
responsibility when using this program.
DISTRIBUTION
────────────
Richard Lemaster releases SFDFC as freeware. You are free to use this
utility without any registration requirement.
If you have any suggestions, comments, or problems with SFDFC,
you can leave me a message in the Fidonet SPITFIRE conference. Or
you call my BBS listed below.
Over The Line BBS
Richard Lemaster - Sysop
Fidonet 1:170/260
Line 1:(918)250-0542 14.4
Line 2:(918)250-2462 14.4
The latest version can always be FREQ'ed with the magic name "SFDFC"
from 1:170/260.
"SPITFIRE" is Copyright (C) 1987-1994 by Mike Woltz.
"SPITFIRE" is a registered trademark of Buffalo Creek Software.
"SFCHKUP" is Copyright (C) 1994 by Mike Woltz.