home *** CD-ROM | disk | FTP | other *** search
- DC - Directory Control
- Version 1.1
- by Peter Esherick
- 1105 Sagebrush TR SE
- Albuquerque, NM 87123
-
- Contact via:
- Albuquerque RBBS 296-7672, John Maio, sysop
- ARPANET/MILNET <esheric@sandia.gov>
-
-
- Command DC
- ----------
-
- Purpose: To allow selective copying, moving, deleting and browsing
- of files displayed in a directory listing.
-
- Format: DC [d:][source-path] [d:][dest-path] [/O,N,E,D,or S][/F][/V][/43]
-
- Remarks:
- This program is closely based on the CO and DR programs, both written
- by Michael J. Mefford and published in PC Magazine, vol.6, #17 and #21,
- 1987. I have combined features from these two programs and also added a
- number of new features of my own. This program is released into the
- public domain, as is, with no warranties of any kind. I will be happy
- to supply source code to any interested party, with the request that, if
- you make any significant changes, modifications, or improvements, you
- please share these changes, preferably in source code form, with me and
- the rest of the PC user community at no charge. Since the original CO
- and DR code that makes up a major part of DC is copyrighted by PC
- Magazine and Mike Mefford, I believe that commercial sale of any
- variations based on this code by anyone but the copyright holders would
- be improper, if not downright illegal.
-
- Usage notes:
- The source and destination directory pathnames are both optional.
- Options, specified by a "/" followed by a letter, may appear either before
- or after the pathnames. The options are as follows:
-
- /N Sort directory by filename
- /E Sort directory by extension
- /D Sort directory by date and time
- /S Sort directory by file size
- /O Use original order, i.e. do not sort directory at all.
- /V Turn on DOS Verify switch for disk file writes
- /F Fast display on IBM Color display adapters (no snow check)
- /43 Start off in 43 line mode with EGA, or 50 line mode with VGA.
-
- DC comes up displaying the "source" or "working" directory. A brief
- menu of optional commands is displayed to the right of the directory
- display. You may move up and down the directory list with the up and down
- arrow keys on the cursor keypad. Files may be individually copied,
- deleted, moved or renamed by pressing the function keys F1 through F4,
- respectively. Alternatively, a number of files may be selected, or
- "marked" using the grey + and - keys on the right side of the keypad.
- After marking, pressing the appropriated function key will apply the
- chosen operation to the entire group of files.
-
- Different directories can be displayed in two ways. One is to press
- the F9 function key and enter a new drive and path name. Alternatively,
- if you want to move to different sub-directories on the same drive, you
- can simply press the "Enter" key after using the up or down arrow keys to
- high-light the desired sub-directory. Note that as always within DOS, ".."
- denotes the parent of a given sub-directory, i.e. the level above the
- currently displayed directory.
-
- Just as pressing Enter lets you view a new directory, pressing Enter
- when a filename is highlighted lets you view the contents of the file. In
- the default mode the display is wrapped at the edge of the screen if a
- line is more than 80 characters wide. This option can be toggled by
- pressing W. Display of non-ascii characters can be toggled with the Ascii
- and Blank options by pressing A or B. In Ascii mode only strings of 5 or
- more normal ascii characters (including tab or space) are displayed. This
- is useful for viewing the messages contained in an .EXE or .COM file.
- With the Blank option, non-ascii characters are replaced with a blank or
- space. A final option, "*", masks the high-order bit of non-ascii
- characters to make wordstar files readable.
-
- DC will use the screen size that DOS is in when invoked and restore
- that mode upon exit. Shift-F10 while in the directory display toggles
- between (43/50 lines) and (25 lines) on the screen. If an EGA is being used,
- 43 lines are always used. If a VGA is being used, 50 lines are always used.
- The number of lines can only be changed if a standard text mode is being used
- (mode 2, 3, & 7). So if you are using a non-standard text mode like 132x43,
- then Shift-F10 does nothing.
-
- The Alt-1 and Alt-2 key combinations will shell to DOS and run the
- pre-defined commands with the current file entry as an argument. By default
- Alt-1 executes "vpic /a" and Alt-2 executes "vplay". These two programs
- can be changed by customizing DC (see later).
-
-
- Key by key summary of commands:
-
- Esc Exit program and return to original directory.
-
- Alt-Q Exit program leaving the currently displayed dir as the
- current default drive and directory for DOS.
-
- Grey + Mark current file entry, if not a sub-directory or hidden
- or Ins file, and advance cursor to next line.
-
- Grey - Remove mark on current file, and advance cursor to next line.
- or Del
-
- Shift F10 Toggle between 43/50 lines and 25 lines (EGA/VGA only).
-
- The following functions operate on the marked files, if any, otherwise
- they operate on the currently highlighted file, provided it is not a
- sub-directory entry. If the operation is successful the mark is
- replaced with an asterisk (*), if unsuccessful the file is passed over,
- leaving the mark, and the program proceeds on to the next marked file.
-
- F1 Copy file(s) via a read/write sequence to requested target
-
- F2 Delete file(s) after asking for confirmation.
- Remove directory if currently pointing to a sub-directory
- that is empty.
-
- F3 Move file(s), - Copy to requested target, delete source.
- Where possible this function is performed using an across
- directory rename instead of a file read/write sequence.
-
- F4 Rename file(s) or <dir> within the currently displayed directory.
-
- F5 Clear all marks
-
- F6 Mark all remaining files, ie those not marked with an "*".
-
- F7 Swap marked and unmarked files.
-
- The following three functions change the active source and dest
- directories:
-
- F8 Swap the Working Directory (source) and the Default
- Destination Directory
-
- F9 Prompt for a new Working (source) Directory
-
- F10 Prompt for a new Default Destination Directory
-
- The directory can be re-sorted by typing:
-
- Alt-N Sort by filename
- Alt-E Sort by file extension (eg .COM vs .DOC)
- Alt-D Sort by date and time
- Alt-S Sort by file size
- Alt-O Re-read and display dir in original, unsorted order
-
- Additional commands not appearing in the menu:
-
- Alt F1 Protected copy - bypass filenames that already exist on target
-
- Alt F2 DOS Shell: Exit temporarily to DOS. You can then run whatever
- programs you need to run, and then return to the DC program by
- typing "exit" at the DOS prompt.
-
- Alt F3 MakeDir: Create a new sub-directory in the default destination
- directory.
-
- Alt F4 RMDIR: Remove the currently highlighted directory, if empty.
-
- Alt R Re-read working directory. Required after changing diskettes
- in a floppy-disk drive.
-
- Alt C Copy (Duplicates F1)
- Alt M Move (Duplicates F3)
- Alt V View (Duplicates Return)
-
- Alt 1 Execute configured DOS command #1 (vpic by default)
- Alt 2 Execute configured DOS command #2 (vplay by default)
-
- View Mode commands:
-
- W Toggle word wrap/horizontal scroll
- A Toggle Ascii string display
- B Toggle blanking of non-Ascii characters
- * Toggle wordstar bit mask (shift non-ascii high-order
- characters (from 128 to 255) down into the display-able
- ascii range of 1 to 127.
- H Hex dump mode. The "B" key to toggle blanking works in hex dump
- mode.
-
-
- Customizing DC.COM
-
- Version 1.1 of DC can be customized to display the menu and dir text
- in the colors of your choice. Rather than building into DC.COM an
- automatic color setting function, I have fallen back on the hacker's
- choice of letting you patch DC.COM with debug. If this scares you,
- learn how to use debug, ask a friend, or learn to love the ridiculous
- choice of colors that is built in to this version. I use a monochrome
- screen, so it just hasn't been a big thing to me before.
-
- Besides understanding DEBUG you need to know two other things: how the
- PC video display cards translates hex numbers into colors, and what
- locations to patch (change) in DC.COM. The table below lists the
- correspondence between hex numbers and foreground and background colors
- on the PC. To get the correct number for a combined foreground color
- plus background number, you add the hex digits for the two. For
- example, brown on a blue background is given by 16h, where as brown on a
- green background is given by 26h. Note that in a hexadecimal
- representation, which is what debug uses, the first digit is the
- background color, while the second (least significant) digit gives the
- foreground color.
-
- Foreground (normal) Foreground (intense) Background
- --------------------------------------------------------------
- 0 black 8 dark gray 0 black
- 1 blue 9 light blue 10h blue
- 2 green 0Ah light green 20h green
- 3 cyan 0Bh light cyan 30h cyan
- 4 red 0Ch light red 40h red
- 5 magenta 0Dh light mag. 50h magenta
- 6 brown 0Eh yellow 60h brown
- 7 gray 0Fh intense white 70h gray
-
- OK, now you now how to define a color. If you are a veteran hacker,
- than the next table tells you all you need to know. If your not,
- hold on, we'll get you there.
-
- Location Name Default Where used
- ------------------------------------------------------
- 03h NORMAL 02 Directory display
- 04h INTENSE 0Bh Pathname display
- 05h MENU 16H Menu display
- 06h BORDER 1EH Menu border
- 07h INVERSE 74H Highlighted dir entry
-
- Now, to use DEBUG to change the default colors, first
- (1) Find DEBUG.COM from your DOS disk if you haven't already got it
- (2) Use COPY to make a copy of DC.COM on a working disk so you don't
- mess up your one and only copy.
- (3) Assuming DEBUG is in the default directory or accessible via the
- path command, and that DC.COM is present in the default directory of the
- currently logged disk, type the following (at the DOS prompt):
-
- DEBUG DC.COM (Debug will respond with a hyphen -)
- d03l5 (Debug will display the current values of the colors)
- e03 (Debug will display the first color, followed by a '.',
- for example 02. At this point type in the one or two
- digit number that you want to use for the NORMAL color.
- If you don't want to change it, press the space bar.
- After entering the number or a space, debug will go on to
- the next color, and you repeat the last step until you
- have entered something for all five colors. If you want
- to quit and go back, press the Enter (return) key, and re-
- enter the e03 command at the '-' prompt. When your done
- here you only two more steps to go:
-
- W (This command writes the modified file back on to the disk.
- (Debug responds with "Writing XXXX bytes", or something close)
-
- Q (And the Q command quits DEBUG and returns you to DOS.
-
-
- Other Patch Locations:
-
-
- Switch character (08h): '/' or '-'
-
- For the UNIX hackers, there's one more byte that you can change at your
- pleasure, and that is one I have labeled SWITCH at location 08h in the
- DC.COM file. The character/byte at location 08h is used to identify an
- option entered on the DOS command line when you first call up DC.
- Normally this is '/', so that options would be specified by /d or /o. By
- changing the byte at location 08 to '-', options can be entered as -d
- or -o. This lets you use '/' in your path names, so that instead of
- entering command lines like:
-
- DC C:\COMM\DOWN D:\UTIL /D
-
- You can now enter:
-
- DC C:/COMM/DOWN D:/UTIL -D or
- DC C:\COMM\DOWN -d D:\UTIL or
- DC -d C:/COMM\DOWN D:/UTIL -D
- But not: DC C:\COMM\DOWN D:/UTIL /D (This will clearly confuse DC)
-
- (Note that since the problem is with the option switch, and since there
- are no options entered with pathnames once the programming is running,
- you can use either / or \ as a path delimiter when entering a
- destination or changing the path with F9 or F10 keys.)
-
-
- Snow Checking (09H): 0h enables, 0FFh disables
-
- When DC starts up it checks BIOS data area (Segment 40) to see if the
- current display adaptor is a monochrome or color card. If it isn't mono,
- then DC will query the display adaptor, before writing a character to the
- display memory, to see if it is ok to do so. This procedure is necessary
- to avoid spurious dots or "snow" on old IBM Color Graphics Adapters (CGA's).
- Unfortunately, this also slows things down quite a bit. If you prefer speed
- over a clean display update on a CGA, then put 0h in the byte at 09h.
- A zero at this location will enables snow checking on CGA displays.
- Monochrome, EGA and VGA display adapters automatically disable snow checking
- since they never need it. If you want to temporarily try out what this patch
- does, use the /F option switch when you start up DC.
-
-
- Minimum memory for directory functions (0Ch):
-
- In its default mode DC will look for at least 32 k for itself and the
- directory information, reserving all remaining full 64k segments for the
- file copy and view buffer. This can be changed by modifying the byte at
- 0Ch from 08h to a new value between 08h (32k) and 10h (64k).
- Since this value corresponds to the memory allocated for both the program
- and the directory info, smaller values than 8 can cause disaster.
-
-
- Force initial video mode to be 43/50 lines (1bh):
-
- Normally the number of lines displayed in DC is the same as what the DOS
- screen was displaying when called. Setting this byte to 1 will force DC
- into 43/50 line mode every time DC is started.
-
-
- Initial directory sorting order:
-
- The directory sorting options are decoded from the command line and
- stored in a word at 30h (SORT_OFFSET) and a byte at 32h (SORT_LEN).
- The following table describes values used for the different cases:
-
- loc type name ext size date nosort
- 30h DW 0 9 0Dh 1Dh 0FFFFh
- 32h DB 0Ch 3 8 0 0
-
-
- Changing the programs executed with the Alt-1 and Alt-2:
-
- The program name executed by Alt-1 starts at 08dh and the program name
- executed by Alt-2 starts at 0b5h. The DOS program name/path must be
- null terminated and can be up to 40 bytes long total.
- This is the default set-up:
-
- DOS_PROG1 DB 'vpic /a', 0, 32 dup(20h) ;DOS_SHELL1 cmd
- DOS_PROG2 DB 'vplay' , 0, 34 dup(20h) ;DOS_SHELL2 cmd
-
-
- Acknowledgments:
- My thanks to Steve Grandi of U. Arizona for adding the DOS shell
- function to DC. Steve has also implemented a UNIX style -switch version
- uses "/" instead of "\" as the path delimiter. Additional thanks to Russ
- Nelson for the alternate menu code and EGA checking and to Gordon Haff
- who has provided numerous ideas through his extensive modification of DC
- into an even better program, DF, also available through your local BBS.
-
-
- Revision history:
-
- DC version 1.1 - August, 1991 (Gerhard Karnik - garyk@cbnewsk.att.com)
- Original DOS screen is restored upon exit from program (up to 132x50)
- ALT 1 now calls up vpic (by default)
- ALT 2 now calls up vplay (by default)
- Marked-file-bytes display now works if more than 10 meg bytes
-
- DC version 1.07 - June, 1990 (Gerhard Karnik - garyk@cbnewsk.att.com)
- Support for screen sizes other than 80x25
- Hexdump mode added
-
- DC version 1.06 - September 2, 1989
- Fix View bug in number of lines displayed
- New patch location for default sort
- Reverse logic of snow check patch point
- Fixed get_mem bug when less than 64k to grab
- complements Russell Nelson:
- Sensing the EGA and disengaging snow control if one is present,
- Changing the menu if they hold down the Alt or Ctrl key.
- Other additions:
- RMDIR and MKDIR
-
- DC version 1.05(b) - October 24, 1988
- Alt F2 for DOS Shell
-
- DC version 1.04(f) - June 8, 1988
- Add Ins/Del as duplicates to Grey +/- keys
- Work on display speed/ cursor overrun problem
- Minor(?) change in memory management
-
- DC version 1.01-1.03 - March 7 to April 6, 1988
- Add customizable colors and switch-char
- Add Rename for directories
- Automatically re-read dir with Alt-O original order sort
- Added Alt-F1 "Protected Copy" function.
- Now highlights last sub-dir viewed when returning to parent dir
- Modified method of handling directory changes
- F9 (change work dir) now relative to displayed work dir
- Allow specifying both source and dest paths on entry
-
- Earlier versions COD1 through COD9: Dec '87 to Mar. '88
- Combined DR and CO,
- Added ability to change directories
- Added "speedometer" display of marked files, bytes
- Added "View" options to toggle word wrap, horizontal scroll,
- blanking or full suppression of non-ASCII
-
- Features that could be added:
-
- Functions to toggle file attributes (hidden, system, etc.).
- Extended DOS shell functions as found in DF by Gordon Haff.
- Improved error messages on disk not ready, etc
- List options: search/scan for text
- display current horizontal scroll position
- improve provisions for re-synch in mode toggles
- Fix bug when shelling to DOS when >80 columns