home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMPRESS / X23.ZIP / X.DOC < prev   
Encoding:
Text File  |  1990-04-23  |  15.1 KB  |  370 lines

  1.  
  2.                        X: the COMLIB Executioner
  3.  
  4.               Copyright (c) 1988, 1989, 1990 by Keith Ledbetter
  5.                         and Orion Micro Systems
  6.  
  7.  
  8.        [>>------------------------------------------------------------<<]
  9.        [>>  Version 2.3 enhancements are at the end of this document  <<]
  10.        [>>------------------------------------------------------------<<]
  11.  
  12.  
  13.   Welcome to X.COM.  When I did a catalog of my \DOS\ directory the other
  14. day and saw 194 files, which were mostly little-used but hard-to-delete
  15. .COM and .EXE files, I figured it was time to do something (yes, I'm a
  16. pack rat).
  17.  
  18.   X.COM was the solution.  X.COM allows you to ARC those seldom-used .COM
  19. and .EXE files into a COMLIB (command library) file, and then quickly
  20. execute them with the X.COM program.  There are many advantages to this;
  21. mainly you free up all of the file slots occupied by those programs, which
  22. makes directory searches much faster.
  23.  
  24.   I started out writing my own "library" (or archiver) program, but then I
  25. came to my senses and realized that ARC (not PKARC) already supports the
  26. ability to "store" files into an ARC file without compressing them.  So, to
  27. use X.COM you *must* have ARC.EXE in one of your PATH subdirectories.
  28. X.COM and ARC.EXE work hand-in-hand EXCEPT for the "extract and run"
  29. function; X does the extraction itself and then spawns the process (at a
  30. very high rate of speed, by the way).
  31.  
  32.   At the heart of X is the environment variable named COMLIB.  On my system,
  33. the main PATH for my commands is \DOS\.  So, in my AUTOEXEC.BAT file I have
  34. the following entry:
  35.  
  36.                        SET COMLIB=C:\DOS\COMLIB.ARC
  37.  
  38.   Change your entry depending on where you want your COMLIB.ARC file to be.
  39.  
  40.   There are two ways to invoke X.COM (which you should place in one of your
  41. PATH directories).  The two invocations are as follows:
  42.  
  43.                        X filename [arguments....]
  44.  
  45.                        X -switch [filemask]
  46.  
  47.   If you invoke X with a '-switch' in the FIRST argument, then X will pass
  48. that switch directly to ARC.EXE to process, supplying the name of your COMLIB
  49. file.  X will also add a "s" to the -switch, so that ARC will work with files
  50. in "stored" mode instead of compressed mode.
  51.  
  52.   If you invoke X without a '-switch' specified, then X will
  53.  
  54.         (a) extract the .COM or .EXE file to a temporary file in the
  55.             root directory of drive C:
  56.  
  57.         (b) execute the command passing any command line arguments
  58.             that you specified
  59.  
  60.         (c) delete the temporary file when the command terminates.
  61.  
  62.  
  63.  
  64.                        Setting up your COMLIB file
  65.                        ---------------------------
  66.  
  67.   OK, enough of that boring stuff!  Let's set up your command library and
  68. see X.COM in action.   I will assume in the following examples that
  69.  
  70.           (a)  you want your command library to be in C:\DOS\
  71.           (b)  C:\DOS\ is specified in your PATH environment variable
  72.  
  73.  
  74. First, you need to set up your COMLIB variable with the following command:
  75.  
  76.                       SET COMLIB=C:\DOS\COMLIB.ARC
  77.  
  78. Next, we need to add some files to your command library.  Since everyone has
  79. the CHKDSK.COM command, we'll add that file.  At the DOS prompt, key in:
  80.  
  81.                       X -a \your_path\chkdsk.com
  82.  
  83. When X.COM sees the '-a' switch, it will spawn ARC.EXE to ADD the member to
  84. your COMLIB file.   After ARC finishes execution, you can verify that it was
  85. indeed added with the following command:
  86.  
  87.                       X -v
  88.  
  89. X.COM will again spawn ARC.EXE to do a "verbose listing" of the files in your
  90. COMLIB file.
  91.  
  92. The final step is to execute CHKDSK.COM from your COMLIB arc file.  Simply
  93. key in:
  94.  
  95.                       X chkdsk
  96.  
  97. X will extract the file and then run it.  That's all there is to it!
  98.  
  99.  
  100.  Don't forget; ANY switch that you can normally give to ARC.EXE you can also
  101. give to X.COM.  You can, for example, "freshen" all files in your COMLIB file
  102. with the command:   X -f.    Also, invoking X.COM with no command line
  103. arguments will give you a short "help screen".
  104.  
  105.   On my system (which is an AT), my COMLIB file currently has 75 entries in
  106. it, yet X.COM can still extract the LAST member in the file and have it
  107. executing in about 3 seconds.   So, you're not going to suffer waiting for
  108. COMLIB'ed files to execute.  I hope you enjoy it.  If you have any questions
  109. or suggestions for improvements, you can reach me at:
  110.  
  111.  
  112.                                       GEnie:    ORION.MICRO
  113.  
  114.                                           Keith Ledbetter
  115.  
  116.  
  117.  
  118. [---------------------------------------------------------------------------]
  119. [---------------------------------------------------------------------------]
  120.  
  121.  
  122.                     Version 1.2 Enhancements and Changes
  123.                     ------------------------------------
  124.  
  125.  
  126.   The changes to version 1.2 of X.COM are relatively minor.  The biggest
  127. change is that you can now store and execute BATCH files from your COMLIB
  128. archive.
  129.  
  130.   This should come in very handy, since batch files are notorious for being
  131. small files that eat up incredible amounts of hard disk space because of the
  132. cluster size overhead.
  133.  
  134.    You add batch files to your COMLIB file just like any other file.  For
  135. example, if you have a batch file named PROCOMM.BAT, just do:
  136.  
  137.                        X -a procomm.bat
  138.  
  139.    (or, "-m" if you want to put it into your COMLIB file and then delete it).
  140. Now, to execute PROCOMM.BAT, you'd just do the following at the DOS prompt:
  141.  
  142.                        X procomm
  143.  
  144.   Can't be much simpler than that!   When you execute a batch file, X.COM does
  145. the following steps:
  146.  
  147.  
  148.             (a)  it extracts the file to the root directory of drive C: under
  149.                  a temporary .BAT name.
  150.  
  151.             (b)  it spawns another copy of COMMAND.COM, passing it the name
  152.                  of the temporary batch file for execution.   X.COM honors
  153.                  (in fact, requires) the COMSPEC environment setting for
  154.                  COMMAND.COM.
  155.  
  156.             (c)  after control returns from COMMAND.COM, it deletes the
  157.                  temporary file from drive C:.
  158.  
  159.  
  160.    Other minor enhancements in this version:
  161.  
  162.  
  163.            o   Unused free memory is released before running the extracted
  164.                command.   Only around 30K of your memory will be eaten up
  165.                by using X.COM to execute another program.   It is very easy
  166.                for me to bring this memory overhead down to around 18K or
  167.                so, but doing so would drastically slow down the time
  168.                required to extract the file out of the COMLIB file.  If you
  169.                have a requirement for a special version like this, just let
  170.                me know.
  171.  
  172.            o   Extraction of members should now be a little bit faster than
  173.                earlier versions.
  174.  
  175.  
  176. [---------------------------------------------------------------------------]
  177. [---------------------------------------------------------------------------]
  178.  
  179.  
  180.                     Version 2.0 Enhancements and Changes
  181.                     ------------------------------------
  182.  
  183.  
  184.   The changes to version 2.0 of X.COM fall into the "major" category.  The
  185. most important change is that X.COM now uses the new PKZIP by Phil Katz, so
  186. that the COMLIB members are actually shrunk down as opposed to just being
  187. "stored as is" like they were with ARC.EXE.
  188.  
  189.   The main reason that I went with PKZIP is that the program can extract
  190. compressed members just about as fast as I could extract the older "stored
  191. only" modules.  There will be a slight speed loss (for example, 3 seconds to
  192. get a program extracted and running instead of 2 seconds), but you will gain
  193. a lot of disk space in return.  PKZIP v1.02 routinely crunches down .EXE
  194. files to around 30% to 50% of their original size.  I think waiting an extra
  195. second or so is worth that much disk savings.
  196.  
  197.   There are two pathways to converting to version 2.0 of X.COM:
  198.  
  199.      1.   IF YOU CURRENTLY USE v1.2 (or less) OF X.COM ...
  200.  
  201.              a.   First, you must convert your COMLIB.ARC file manually
  202.                   to a COMLIB.ZIP file.  Simply create a temp directory,
  203.                   extract all members from the ARC file, and then ZIP them
  204.                   into your new COMLIB.ZIP file.
  205.  
  206.              b.   Change your AUTOEXEC.BAT file to reflect that your COMLIB
  207.                   file is now a ZIP file (ie: SET COMLIB=D:\UTILS\COMLIB.ZIP).
  208.                   Actually, SET COMLIB=D:\UTILS\COMLIB will work, too.
  209.  
  210.  
  211.  or  2.   IF YOU DO NOT CURRENTLY USE v1.2 (or less) OF X.COM ...
  212.  
  213.              a.   Simply set things up as described in the above older
  214.                   documentation, except for:
  215.  
  216.                      -   PKZIP/PKUNZIP.EXE must be in your PATH instead
  217.                          of ARC.EXE.
  218.                      -   name your COMLIB file to xxxx.ZIP instead of .ARC.
  219.  
  220.  
  221.  
  222. Operational changes
  223. -------------------
  224.  
  225.    To the user, v2.0 of X.COM seems as though it processes things exactly
  226. like v1.x did.  In the overall scheme of things, it does; but, in reality,
  227. there had to be a few differences since PKUNZIP is now doing the extracting.
  228. Here is what happens now when you execute a COMLIB member:
  229.  
  230.        for example:   X WHEREIS *.bat
  231.  
  232.              1.  A temp directory is created in the root directory of C:\
  233.              2.  X spawns off PKUNZIP.EXE to extract WHEREIS.*
  234.              3.  If more than one WHEREIS.* file exists, give the user an
  235.                  error message telling them that the names must be unique.
  236.              4.  If the extracted file is a BATCH file
  237.                     spawn a second copy of COMMAND.COM and execute it
  238.                  Else
  239.                     spawn the program that was extracted.
  240.              5.  Delete all files in the temporary directory.
  241.              6.  Delete the temporary directory.
  242.  
  243.  
  244. Passing switches
  245. ----------------
  246.  
  247.     The switch to PKZIP/PKUNZIP is also complicated by the fact that there are
  248. TWO programs instead of the singular ARC.EXE which did all ARC processing.  So,
  249. when you pass a "-switch" through X.COM, it treats things like this:
  250.  
  251.           If the switch is -X (extract), -V (verbose list), -T (test),
  252.           or -C (print to screen) then
  253.                 spawn off PKUNZIP.EXE
  254.           else
  255.                 spawn off PKZIP.EXE
  256.  
  257.    So, if you need to execute PKUNZIP with a switch other than -x, -v, -t,
  258. or -c, you'll have to do it manually.
  259.  
  260.  
  261.  
  262. [---------------------------------------------------------------------------]
  263. [---------------------------------------------------------------------------]
  264.  
  265.  
  266.                     Version 2.1 Enhancements and Changes
  267.                     ------------------------------------
  268.  
  269.     Version 2.1 fixes a bug (well, actually an oversite) where X would not
  270. pass all of the parameters that you specified to PKZIP/PKUNZIP.  X.COM would
  271. only pass the first filename that you specified.  For example, if you did the
  272. following command:
  273.  
  274.          X -x edit.bat abc.bat test.bat e:\outdir\
  275.  
  276. which says "extract the files EDIT.BAT, ABC.BAT, and TEST.BAT from my system
  277. COMLIB file, and place them into the directory named E:\OUTDIR\", X.COM would
  278. only pass the following to PKUNZIP:
  279.  
  280.          PKUNZIP -x \path\comlib.zip edit.bat
  281.  
  282. which, of course, didn't quite end up with the expected results.  X.COM will
  283. now correctly pass all of the arguments you specify; using the above example,
  284. X.COM would now correctly spawn PKUNZIP as follows:
  285.  
  286.          PKUNZIP -x \path\comlib.zip edit.bat abc.bat test.bat e:\outdir\
  287.  
  288.  
  289.   Thanks to Bruce Bordonaro of Ramsey, NJ for documenting this oversite and
  290. contacting me about it (I can't get anything past you guys!).
  291.  
  292.  
  293.  
  294. [---------------------------------------------------------------------------]
  295. [---------------------------------------------------------------------------]
  296.  
  297.  
  298.                     Version 2.2 Enhancements and Changes
  299.                     ------------------------------------
  300.  
  301.     The only change made in version 2.2 is the ability for you to specify the
  302. drive where you want X.COM to place the temporary extracted file.  Earlier
  303. versions of X.COM would always put this temporary file on drive C:.
  304.  
  305.     Of course, this caused problems for those people who run "disk manager"
  306. programs that only put a very small boot partition on drive C:, and then
  307. allocate the entire rest of the hard drive as drive D:.   What would happen
  308. is that PKUNZIP would run out of disk space when trying to extract the file
  309. to drive C:, which would in turn make X.COM respond with "That file doesn't
  310. exist in your COMLIB file!".
  311.  
  312.     By default, X.COM still uses drive C as the temporary drive.  But, you
  313. can over-ride this by simply defining an environment variable named X_DRIVE.
  314. For example, if you'd like for X.COM to use drive D: as the holding area for
  315. the temporary file, just put the following command in your AUTOEXEC.BAT file:
  316.  
  317.                     Set X_Drive=D
  318.  
  319.  
  320. [---------------------------------------------------------------------------]
  321. [---------------------------------------------------------------------------]
  322.  
  323.  
  324.                     Version 2.3 Enhancements and Changes
  325.                     ------------------------------------
  326.  
  327.     The changes made in version 2.3 are transparent to the user.  The main
  328. reason behind the new version was to optimize the code more, thus cutting
  329. down on the amount of memory reserved by X before running another program.
  330. Version 2.3 reserves about 8K less memory than v2.2 did, giving you even
  331. more memory to run programs in (roughly 15K instead of v2.2's 23K overhead).
  332.  
  333.      On another note ... I have had numerous people suggest the same thing
  334. to me: the ability to have multiple COMLIBs.  So far, I haven't been able
  335. to come up with an idea of how to integrate this into X without causing
  336. more work on the user to invoke a program.  To me, the most important thing
  337. with X.COM is that you simply have to place an "x" in front of your command
  338. line.   If you have any ideas on how this can be easily done, please leave
  339. me some Email at the numbers listed below.
  340.  
  341.  
  342.  
  343. In conclusion
  344. -------------
  345.  
  346.     If you use PKZIP/PKUNZIP regularly, please register your copy!  We need
  347. quality shareware, and the market will dwindle if there is no monetary support
  348. for the authors.  Remember, you vote with your wallet!
  349.  
  350.    Last, but not least, concerning contributions on this and any other of my
  351. "freeware" programs:  My stand is simple - contributions are not required, but
  352. they are HEARTILY accepted (note the accent on HEARTILY...grin).   If you feel
  353. that you'd like to make a contribution for X.COM, or if you'd like to drop me
  354. a line with any suggestions, you can reach me at any of the following:
  355.  
  356.                       Keith Ledbetter
  357.                       4240 Ketcham Drive
  358.                       Chesterfield, VA  23832
  359.  
  360.                    or GEnie ID:  ORION.MICRO
  361.  
  362.   If you are not a member of GEnie, you can contact me on the Blue Ridge
  363. Express BBS at (804) 790-1675, user name "Keith Ledbetter".  This board
  364. runs 24 hours a day at 300/1200/2400 baud, and is well worth the call.
  365.  
  366.  
  367.                       Enjoy!
  368.  
  369.                            Keith Ledbetter
  370.