home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / DC11.ZIP / DC.DOC < prev    next >
Encoding:
Text File  |  1991-10-14  |  18.0 KB  |  405 lines

  1.                  DC - Directory Control
  2.                       Version 1.1
  3.                    by Peter Esherick
  4.                   1105 Sagebrush TR SE
  5.                   Albuquerque, NM 87123
  6.  
  7.            Contact via:
  8.            Albuquerque RBBS  296-7672, John Maio, sysop
  9.            ARPANET/MILNET    <esheric@sandia.gov>
  10.  
  11.  
  12. Command DC
  13. ----------
  14.  
  15. Purpose:  To allow selective copying, moving, deleting and browsing
  16.           of files displayed in a directory listing.
  17.  
  18. Format:   DC [d:][source-path] [d:][dest-path] [/O,N,E,D,or S][/F][/V][/43]
  19.  
  20. Remarks:
  21.    This program is closely based on the CO and DR programs, both written
  22. by Michael J. Mefford and published in PC Magazine, vol.6, #17 and #21,
  23. 1987.  I have combined features from these two programs and also added a
  24. number of new features of my own.  This program is released into the
  25. public domain, as is, with no warranties of any kind.  I will be happy
  26. to supply source code to any interested party, with the request that, if
  27. you make any significant changes, modifications, or improvements, you
  28. please share these changes, preferably in source code form, with me and
  29. the rest of the PC user community at no charge.  Since the original CO
  30. and DR code that makes up a major part of DC is copyrighted by PC
  31. Magazine and Mike Mefford, I believe that commercial sale of any
  32. variations based on this code by anyone but the copyright holders would
  33. be improper, if not downright illegal.
  34.  
  35. Usage notes:
  36.    The source and destination directory pathnames are both optional.
  37. Options, specified by a "/" followed by a letter, may appear either before
  38. or after the pathnames.  The options are as follows:
  39.  
  40. /N      Sort directory by filename
  41. /E      Sort directory by extension
  42. /D      Sort directory by date and time
  43. /S      Sort directory by file size
  44. /O      Use original order, i.e. do not sort directory at all.
  45. /V      Turn on DOS Verify switch for disk file writes
  46. /F      Fast display on IBM Color display adapters (no snow check)
  47. /43     Start off in 43 line mode with EGA, or 50 line mode with VGA.
  48.  
  49.    DC comes up displaying the "source" or "working" directory.  A brief
  50. menu of optional commands is displayed to the right of the directory
  51. display.  You may move up and down the directory list with the up and down
  52. arrow keys on the cursor keypad.  Files may be individually copied,
  53. deleted, moved or renamed by pressing the function keys F1 through F4,
  54. respectively.  Alternatively, a number of files may be selected, or
  55. "marked" using the grey + and - keys on the right side of the keypad.
  56. After marking, pressing the appropriated function key will apply the
  57. chosen operation to the entire group of files.
  58.  
  59.    Different directories can be displayed in two ways.  One is to press
  60. the F9 function key and enter a new drive and path name.  Alternatively,
  61. if you want to move to different sub-directories on the same drive, you
  62. can simply press the "Enter" key after using the up or down arrow keys to
  63. high-light the desired sub-directory.  Note that as always within DOS, ".."
  64. denotes the parent of a given sub-directory, i.e. the level above the
  65. currently displayed directory.
  66.  
  67.    Just as pressing Enter lets you view a new directory, pressing Enter
  68. when a filename is highlighted lets you view the contents of the file.  In
  69. the default mode the display is wrapped at the edge of the screen if a
  70. line is more than 80 characters wide.  This option can be toggled by
  71. pressing W.  Display of non-ascii characters can be toggled with the Ascii
  72. and Blank options by pressing A or B.  In Ascii mode only strings of 5 or
  73. more normal ascii characters (including tab or space) are displayed.  This
  74. is useful for viewing the messages contained in an .EXE or .COM file.
  75. With the Blank option, non-ascii characters are replaced with a blank or
  76. space.  A final option, "*", masks the high-order bit of non-ascii
  77. characters to make wordstar files readable.
  78.  
  79.    DC will use the screen size that DOS is in when invoked and restore
  80. that mode upon exit.  Shift-F10 while in the directory display toggles
  81. between (43/50 lines) and (25 lines) on the screen.  If an EGA is being used,
  82. 43 lines are always used.  If a VGA is being used, 50 lines are always used.
  83. The number of lines can only be changed if a standard text mode is being used
  84. (mode 2, 3, & 7).  So if you are using a non-standard text mode like 132x43,
  85. then Shift-F10 does nothing.
  86.  
  87.    The Alt-1 and Alt-2 key combinations will shell to DOS and run the
  88. pre-defined commands with the current file entry as an argument.  By default
  89. Alt-1 executes "vpic /a" and Alt-2 executes "vplay".  These two programs
  90. can be changed by customizing DC (see later).
  91.  
  92.  
  93. Key by key summary of commands:
  94.  
  95.    Esc     Exit program and return to original directory.
  96.  
  97.   Alt-Q    Exit program leaving the currently displayed dir as the
  98.            current default drive and directory for DOS.
  99.  
  100.   Grey +   Mark current file entry, if not a sub-directory or hidden
  101.   or Ins   file, and advance cursor to next line.
  102.  
  103.   Grey -   Remove mark on current file, and advance cursor to next line.
  104.   or Del
  105.  
  106.   Shift F10 Toggle between 43/50 lines and 25 lines (EGA/VGA only).
  107.  
  108. The following functions operate on the marked files, if any, otherwise
  109. they operate on the currently highlighted file, provided it is not a
  110. sub-directory entry.  If the operation is successful the mark is
  111. replaced with an asterisk (*), if unsuccessful the file is passed over,
  112. leaving the mark, and the program proceeds on to the next marked file.
  113.  
  114.     F1      Copy file(s) via a read/write sequence to requested target
  115.  
  116.     F2      Delete file(s) after asking for confirmation.
  117.             Remove directory if currently pointing to a sub-directory
  118.             that is empty.
  119.  
  120.     F3      Move file(s), - Copy to requested target, delete source.
  121.             Where possible this function is performed using an across
  122.             directory rename instead of a file read/write sequence.
  123.  
  124.     F4      Rename file(s) or <dir> within the currently displayed directory.
  125.  
  126.     F5      Clear all marks
  127.  
  128.     F6      Mark all remaining files, ie those not marked with an "*".
  129.  
  130.     F7      Swap marked and unmarked files.
  131.  
  132.    The following three functions change the active source and dest
  133.    directories:
  134.  
  135.     F8      Swap the Working Directory (source) and the Default
  136.             Destination Directory
  137.  
  138.     F9      Prompt for a new Working (source) Directory
  139.  
  140.     F10     Prompt for a new Default Destination Directory
  141.  
  142. The directory can be re-sorted by typing:
  143.  
  144.  Alt-N       Sort by filename
  145.  Alt-E       Sort by file extension (eg .COM vs .DOC)
  146.  Alt-D       Sort by date and time
  147.  Alt-S       Sort by file size
  148.  Alt-O       Re-read and display dir in original, unsorted order
  149.  
  150.  Additional commands not appearing in the menu:
  151.  
  152.  Alt F1      Protected copy - bypass filenames that already exist on target
  153.  
  154.  Alt F2      DOS Shell: Exit temporarily to DOS.  You can then run whatever
  155.              programs you need to run, and then return to the DC program by
  156.              typing "exit" at the DOS prompt.
  157.  
  158.  Alt F3      MakeDir: Create a new sub-directory in the default destination
  159.              directory.
  160.  
  161.  Alt F4      RMDIR: Remove the currently highlighted directory, if empty.
  162.  
  163.  Alt R       Re-read working directory.  Required after changing diskettes
  164.              in a floppy-disk drive.
  165.  
  166.  Alt C       Copy (Duplicates F1)
  167.  Alt M       Move (Duplicates F3)
  168.  Alt V       View (Duplicates Return)
  169.  
  170.  Alt 1       Execute configured DOS command #1 (vpic by default)
  171.  Alt 2       Execute configured DOS command #2 (vplay by default)
  172.  
  173.  View Mode commands:
  174.  
  175.  W           Toggle word wrap/horizontal scroll
  176.  A           Toggle Ascii string display
  177.  B           Toggle blanking of non-Ascii characters
  178.  *           Toggle wordstar bit mask (shift non-ascii high-order
  179.              characters (from 128 to 255) down into the display-able
  180.              ascii range of 1 to 127.
  181.  H           Hex dump mode.  The "B" key to toggle blanking works in hex dump
  182.              mode.
  183.  
  184.  
  185. Customizing DC.COM
  186.  
  187. Version 1.1 of DC can be customized to display the menu and dir text
  188. in the colors of your choice.  Rather than building into DC.COM an
  189. automatic color setting function, I have fallen back on the hacker's
  190. choice of letting you patch DC.COM with debug.  If this scares you,
  191. learn how to use debug, ask a friend, or learn to love the ridiculous
  192. choice of colors that is built in to this version.  I use a monochrome
  193. screen, so it just hasn't been a big thing to me before.
  194.  
  195. Besides understanding DEBUG you need to know two other things: how the
  196. PC video display cards translates hex numbers into colors, and what
  197. locations to patch (change) in DC.COM.  The table below lists the
  198. correspondence between hex numbers and foreground and background colors
  199. on the PC.  To get the correct number for a combined foreground color
  200. plus background number, you add the hex digits for the two.  For
  201. example, brown on a blue background is given by 16h, where as brown on a
  202. green background is given by 26h.  Note that in a hexadecimal
  203. representation, which is what debug uses, the first digit is the
  204. background color, while the second (least significant) digit gives the
  205. foreground color.
  206.  
  207. Foreground (normal)  Foreground (intense)         Background
  208. --------------------------------------------------------------
  209.  0  black              8   dark gray               0   black
  210.  1  blue               9   light blue             10h  blue
  211.  2  green             0Ah  light green            20h  green
  212.  3  cyan              0Bh  light cyan             30h  cyan
  213.  4  red               0Ch  light red              40h  red
  214.  5  magenta           0Dh  light mag.             50h  magenta
  215.  6  brown             0Eh  yellow                 60h  brown
  216.  7  gray              0Fh  intense white          70h  gray
  217.  
  218. OK, now you now how to define a color.  If you are a veteran hacker,
  219. than the next table tells you all you need to know.  If your not,
  220. hold on, we'll get you there.
  221.  
  222. Location  Name       Default      Where used
  223. ------------------------------------------------------
  224. 03h       NORMAL       02         Directory display
  225. 04h       INTENSE      0Bh        Pathname display
  226. 05h       MENU         16H        Menu display
  227. 06h       BORDER       1EH        Menu border
  228. 07h       INVERSE      74H        Highlighted dir entry
  229.  
  230. Now, to use DEBUG to change the default colors, first
  231. (1) Find DEBUG.COM from your DOS disk if you haven't already got it
  232. (2) Use COPY to make a copy of DC.COM on a working disk so you don't
  233. mess up your one and only copy.
  234. (3) Assuming DEBUG is in the default directory or accessible via the
  235. path command, and that DC.COM is present in the default directory of the
  236. currently logged disk, type the following (at the DOS prompt):
  237.  
  238. DEBUG DC.COM  (Debug will respond with a hyphen -)
  239. d03l5         (Debug will display the current values of the colors)
  240. e03           (Debug will display the first color, followed by a '.',
  241.               for example 02.  At this point type in the one or two
  242.               digit number that you want to use for the NORMAL color.
  243.               If you don't want to change it, press the space bar.
  244.               After entering the number or a space, debug will go on to
  245.               the next color, and you repeat the last step until you
  246.               have entered something for all five colors.  If you want
  247.               to quit and go back, press the Enter (return) key, and re-
  248.               enter the e03 command at the '-' prompt.  When your done
  249.               here you only two more steps to go:
  250.  
  251. W             (This command writes the modified file back on to the disk.
  252.               (Debug responds with "Writing XXXX bytes", or something close)
  253.  
  254. Q             (And the Q command quits DEBUG and returns you to DOS.
  255.  
  256.  
  257. Other Patch Locations:
  258.  
  259.  
  260. Switch character (08h):  '/' or '-'
  261.  
  262. For the UNIX hackers, there's one more byte that you can change at your
  263. pleasure, and that is one I have labeled SWITCH at location 08h in the
  264. DC.COM file.  The character/byte at location 08h is used to identify an
  265. option entered on the DOS command line when you first call up DC.
  266. Normally this is '/', so that options would be specified by /d or /o. By
  267. changing the byte at location 08 to '-', options can be entered as -d
  268. or -o.  This lets you use '/' in your path names, so that instead of
  269. entering command lines like:
  270.  
  271. DC  C:\COMM\DOWN D:\UTIL /D
  272.  
  273. You can now enter:
  274.  
  275. DC  C:/COMM/DOWN  D:/UTIL -D    or
  276. DC  C:\COMM\DOWN -d  D:\UTIL    or
  277. DC  -d  C:/COMM\DOWN  D:/UTIL -D
  278. But not:  DC C:\COMM\DOWN  D:/UTIL /D    (This will clearly confuse DC)
  279.  
  280. (Note that since the problem is with the option switch, and since there
  281. are no options entered with pathnames once the programming is running,
  282. you can use either / or \ as a path delimiter when entering a
  283. destination or changing the path with F9 or F10 keys.)
  284.  
  285.  
  286. Snow Checking (09H):  0h enables, 0FFh disables
  287.  
  288. When DC starts up it checks BIOS data area (Segment 40) to see if the
  289. current display adaptor is a monochrome or color card.  If it isn't mono,
  290. then DC will query the display adaptor, before writing a character to the
  291. display memory, to see if it is ok to do so.  This procedure is necessary
  292. to avoid spurious dots or "snow" on old IBM Color Graphics Adapters (CGA's).
  293. Unfortunately, this also slows things down quite a bit.  If you prefer speed
  294. over a clean display update on a CGA, then put 0h in the byte at 09h.
  295. A zero at this location will enables snow checking on CGA displays.
  296. Monochrome, EGA and VGA display adapters automatically disable snow checking
  297. since they never need it.  If you want to temporarily try out what this patch
  298. does, use the /F option switch when you start up DC.
  299.  
  300.  
  301. Minimum memory for directory functions (0Ch):
  302.  
  303. In its default mode DC will look for at least 32 k for itself and the
  304. directory information, reserving all remaining full 64k segments for the
  305. file copy and view buffer.  This can be changed by modifying the byte at
  306. 0Ch from 08h to a new value between 08h (32k) and 10h (64k).
  307. Since this value corresponds to the memory allocated for both the program
  308. and the directory info, smaller values than 8 can cause disaster.
  309.  
  310.  
  311. Force initial video mode to be 43/50 lines (1bh):
  312.  
  313. Normally the number of lines displayed in DC is the same as what the DOS
  314. screen was displaying when called.  Setting this byte to 1 will force DC
  315. into 43/50 line mode every time DC is started.
  316.  
  317.  
  318. Initial directory sorting order:
  319.  
  320. The directory sorting options are decoded from the command line and
  321. stored in a word at 30h (SORT_OFFSET) and a byte at 32h (SORT_LEN).
  322. The following table describes values used for the different cases:
  323.  
  324. loc  type  name   ext  size  date       nosort
  325. 30h   DW    0      9    0Dh   1Dh        0FFFFh
  326. 32h   DB    0Ch    3     8     0           0
  327.  
  328.  
  329. Changing the programs executed with the Alt-1 and Alt-2:
  330.  
  331. The program name executed by Alt-1 starts at 08dh and the program name
  332. executed by Alt-2 starts at 0b5h.  The DOS program name/path must be
  333. null terminated and can be up to 40 bytes long total.
  334. This is the default set-up:
  335.  
  336. DOS_PROG1       DB      'vpic /a', 0, 32 dup(20h)   ;DOS_SHELL1 cmd
  337. DOS_PROG2       DB      'vplay'  , 0, 34 dup(20h)   ;DOS_SHELL2 cmd
  338.  
  339.  
  340. Acknowledgments:
  341.    My thanks to Steve Grandi of U. Arizona for adding the DOS shell
  342. function to DC.  Steve has also implemented a UNIX style -switch version
  343. uses "/" instead of "\" as the path delimiter.  Additional thanks to Russ
  344. Nelson for the alternate menu code and EGA checking and to Gordon Haff
  345. who has provided numerous ideas through his extensive modification of DC
  346. into an even better program, DF, also available through your local BBS.
  347.  
  348.  
  349. Revision history:
  350.  
  351. DC version 1.1 - August, 1991   (Gerhard Karnik - garyk@cbnewsk.att.com)
  352.         Original DOS screen is restored upon exit from program (up to 132x50)
  353.         ALT 1 now calls up vpic (by default)
  354.         ALT 2 now calls up vplay (by default)
  355.         Marked-file-bytes display now works if more than 10 meg bytes
  356.  
  357. DC version 1.07 - June, 1990    (Gerhard Karnik - garyk@cbnewsk.att.com)
  358.         Support for screen sizes other than 80x25
  359.         Hexdump mode added
  360.  
  361. DC version 1.06 - September 2, 1989
  362.         Fix View bug in number of lines displayed
  363.         New patch location for default sort
  364.         Reverse logic of snow check patch point
  365.         Fixed get_mem bug when less than 64k to grab
  366.    complements Russell Nelson:
  367.         Sensing the EGA and disengaging snow control if one is present,
  368.         Changing the menu if they hold down the Alt or Ctrl key.
  369.    Other additions:
  370.         RMDIR and MKDIR
  371.  
  372. DC version 1.05(b) - October 24, 1988
  373.         Alt F2 for DOS Shell
  374.  
  375. DC version 1.04(f) - June 8, 1988
  376.         Add Ins/Del as duplicates to Grey +/- keys
  377.         Work on display speed/ cursor overrun problem
  378.         Minor(?) change in memory management
  379.  
  380. DC version 1.01-1.03  - March 7 to April 6, 1988
  381.         Add customizable colors and switch-char
  382.         Add Rename for directories
  383.         Automatically re-read dir with Alt-O original order sort
  384.         Added Alt-F1 "Protected Copy" function.
  385.         Now highlights last sub-dir viewed when returning to parent dir
  386.         Modified method of handling directory changes
  387.         F9 (change work dir) now relative to displayed work dir
  388.         Allow specifying both source and dest paths on entry
  389.  
  390. Earlier versions COD1 through COD9: Dec '87 to Mar. '88
  391.         Combined DR and CO,
  392.         Added ability to change directories
  393.         Added "speedometer" display of marked files, bytes
  394.         Added "View" options to toggle word wrap, horizontal scroll,
  395.              blanking or full suppression of non-ASCII
  396.  
  397. Features that could be added:
  398.  
  399.   Functions to toggle file attributes (hidden, system, etc.).
  400.   Extended DOS shell functions as found in DF by Gordon Haff.
  401.   Improved error messages on disk not ready, etc
  402.   List options:   search/scan for text
  403.                   display current horizontal scroll position
  404.                   improve provisions for re-synch in mode toggles
  405.   Fix bug when shelling to DOS when >80 columns