QNAME3.C
By Henry Gerlach
May 12, 1993

Based on:



QNAME2.C
by David J. Semon
March 22, 1991

The following is the original documentation for QNAME2
After that is the documentation of the changes that I, Henry Gerlach,
made.


---------------------------------------------------------------------
This program, QNAME2.C, is based on the idea found in QNAME.C
written by Martin Leon (AKA HMan) of Ashton-Tate.  I recommend
you read the text file named QNAME.TXT to get the idea of the
original program.
---------------------------------------------------------------------

QNAME2's purpose is to automate renaming of QWK packets.  It
renames QWK files using the first three characters of the original
file name, the current month and day, followed by a letter to
distinguish between multiple packets downloaded the same day from
the same bulletin board.  The letter will go all the way up to the
letter Z, so you can download and rename 26 QWK files a day from the
same bulletin board without a name conflict.

Here are some of the rules the program follows:

1. SYNTAX:  QNAME2 <filename>

   -- No EXT is necessary; QNAME2 adds QWK as the extension.
   -- <filename> is the name the BBS assigns to the QWK file you
      download.  Examples:  Ashton-Tate BBS is ATBBS.
                            Semware BBS is SEMWARE.

2. QNAME2 looks in the current directory for the QWK file to rename.

3. If no file name is provided, a message displays the correct syntax.

4. If the file name is not found, a message is displayed saying so.

5. If the file name is found, QNAME2 renames the file to a new name
   that contains the first three characters of the input file name plus
   current day, month and a sequence letter (A,B,C,D, etc.).

       Examples:     Assume DOS date = 03/22/91
                     Assume first file renamed on that date

                     ATBBS    becomes  ATB0322A.QWK
                     SEMWARE  becomes  SEM0322A.QWK
                     ABCDEFGH becomes  ABC0322A.QWK
                     AB       becomes  AB0322A.QWK
                     A        becomes  A0322A.QWK

6. If the destination file name already exists, QNAME2 increments
   the last letter by one character and renames the original using
   the new last letter.

       Example:      Assume DOS date = 03/22/91
                     Assume ATB0322A.QWK already exists

                     ATBBS    becomes  ATB0322B.QWK


Although you could type QNAME2 <filename> from the DOS prompt, I find
the best way to use the program is to include it in the BAT file I use
to start my communication program so that it is automatically run when
I exit from the communication program.  Put in an entry for each bulletin
board file you want renamed.  Remember, if the file doesn't exist, you
simply get a message saying so.  Also, remember, the current directory
must be the one containing the QWK files for QNAME2 to work.

An example BAT file would be:

C:
CD C:\TELIX           * Change to TELIX directory
TELIX                 * Run TELIX
CD C:\DOWNLOAD        * Change to download directory for QWK files
QNAME2 ATBBS          * Rename ATBBS.QWK
QNAME2 SEMWARE        * Rename SEMWARE.QWK
QNAME2 OASIS          * Rename OASIS.QWK
QNAME2 ADBUS          * Rename ADBUS.QWK
    .
    .
    .
QNAME2 FINAL          * Rename FINAL.QWK
CD C:\


QNAME2 can be in any directory in your PATH, but the QWK files you
want to rename MUST be in the current directory.

---------------------------------------------------------------------

Hope you find this helpful.  I've tested the program with as many
combinations as I could think up with no problems.  If you find any
problems, leave a message for me on the Ashton-Tate BBS (User ID is
EAGLEONE) or on COMPUSERVE (User ID is 73257,3332) or on the Semware
BBS (Qedit) in Atlanta, GA.

I've also included the C source code for those who want to review or
change it for themselves.  If you do, please don't distribute your
version unless you change the name and clearly annotate the changes.
This will avoid confusion if someone has a problem.

This program is for use by the public domain.  It may not be sold at
all.  Feel free to distribute to anyone who can benefit from it.


Dave Semon


--------------------------------------------------------------------------
Changes to QNAME2 to make QNAME3 By Henry Gerlach


   1.  remodified to again compile with MS Quick C.

   2.  Program now accepts additional arguments; Additional paths
       in which to look for a file matching the prospective new name.
       There is no limit to how many paths can be searched, except
       for how many will fit on the command line.

   3.  File to be changed need not be in current directory. A path
       may be included with the name.

   4.  extension need not be .QWK. if no extension is given, .QWK
       will be assumed.

   5.  QNAME3.EXE is now smaller, in spite of all the additions.
       No, I didn't use PKLITE. You are free to do so If you wish.


I've also included the C source code for those who want to review or
change it for themselves.  If you do, please don't distribute your
version unless you change the name and clearly annotate the changes.
This will avoid confusion if someone has a problem.

This program is for use by the public domain.  It may not be sold at
all.  Feel free to distribute to anyone who can benefit from it.

Henry Gerlach.
I may be reached at:
internet: henry.gerlach@pcohio.com
fidonet:  (1:157/200)
