home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / UTILS / A-G / CDIR2_15 / CDIR2.DOC < prev    next >
Text File  |  1994-08-21  |  17KB  |  528 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                            Color DIRectory utility
  12.                             Version 1.50 for OS/2
  13.                       Copyright 1993, 1994 by Dale Couch
  14.                                        
  15.                                        
  16.                                        
  17.                                        
  18.                                        
  19.                                        
  20.                                        
  21.                                        
  22.                                        
  23.                                        
  24.                                        
  25.                                        
  26.                                        
  27.                                        
  28.                                        
  29.                                 What is CDIR2?
  30.                                 --------------
  31.  
  32. CDIR2 is a utility that works the same as the DIR command that you are all
  33. accustomed to with OS/2 and DOS, with one exception, it displays all of the
  34. filenames in color.  You can configure the default colors to use, what colors
  35. the directory entries should be, and you can define the color that files with
  36. certain extensions or certain strings should be.
  37.  
  38.  
  39. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 2
  40.  
  41.  
  42. How do you use CDIR2?
  43. ---------------------
  44.  
  45. SYNTAX:   CDIR2 [drive:[path]] [options]
  46.  
  47. USAGE:    Where drive represents a valid disk drive, locally attached or
  48.           remotely attached via a network.
  49.  
  50.           Where path represents a valid path present on that drive.
  51.  
  52.  
  53. Where [options] includes any of the following:
  54.  
  55. SYNTAX:   /A[adshr][-a-d-s-h-r]
  56.  
  57. USAGE:    Shows files with at least these attributes, based on the following:
  58.  
  59.           a represents the archive attribute
  60.           d represents the directory attribute
  61.           s represents the system attribute
  62.           h represents the hidden attribute
  63.           r represents the read only attribute
  64.  
  65.           if you include a '-' in front of an attribute all files that do not
  66.           have that attribute will be shown.
  67.  
  68. EXAMPLES:
  69.           
  70.      CDIR /Aas
  71.  
  72.           Will show all files that have the archive and system attribute bit
  73.           set on.
  74.  
  75.      CDIR /A-a-d
  76.  
  77.           Will show all files that do not have the archive bit set on and will
  78.           not show any directories.
  79.  
  80.      CDIR /A
  81.  
  82.           Will show all files regardless of their attribute setting.
  83.  
  84.  
  85. SYNTAX:   /B
  86.  
  87. Usage:    List filenames and extensions without displaying any other drive or
  88.           file information.  When the recurse option (/S) is used the filenames
  89.           will be show with a fully qualified path.
  90.  
  91.  
  92. SYNTAX:   /F
  93.  
  94. USAGE:    By default CDIR writes directly to the screen.  This option will
  95.           force CDIR2 to go through OS/2 to display its output.  Color
  96.           highlighting will not be possible when this option is on.
  97.  
  98.  
  99. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 3
  100.  
  101.  
  102. [options] continued ...
  103.  
  104.  
  105. SYNTAX:   /L
  106.  
  107. USAGE:    Shows all filenames in lower case.
  108.  
  109.  
  110. SYNTAX:   /N
  111.  
  112. USAGE:    Shows the file name at the end of the line instead of at the
  113.           beginning.
  114.  
  115.  
  116. SYNTAX:   /O[degns][-d-e-g-n-s]
  117.  
  118. USAGE:    Sorts the filenames in ascending order based on the following:
  119.  
  120.           d represents sort on file date and time
  121.           e represents sort on file extension
  122.           g represents display directories first
  123.           n represents sort on file name
  124.           s represents sort on file size     
  125.  
  126.           If you wish to reverse the order of the sort, place a '-' before the
  127.           sort option.
  128.  
  129.  
  130. EXAMPLES:
  131.  
  132.      CDIR /Os 
  133.  
  134.           Will display files in smallest to largest file size order.
  135.  
  136.      CDIR /O-s
  137.  
  138.           Will display files in largest to smallest file size order.
  139.  
  140.  
  141. SYNTAX:   /P
  142.  
  143. USAGE:    Pauses the display of files for each screen page.  The page length
  144.           will be determined when CDIR is executed and will accommodate all
  145.           screen lengths.  Pressing ESC at any Pause prompt will exit CDIR
  146.           without displaying any more information.  Pressing N or n will
  147.           continue displaying the directory listing without pausing.
  148.  
  149.  
  150. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 4
  151.  
  152.  
  153. [options] continued ...
  154.  
  155.  
  156. SYNTAX:   /R{[D][N][S][T]}{[G][GE][E][LE][L]} value
  157.  
  158. USAGE:    Restrict the files that are displayed.  This option will allow you to
  159.           limit the filenames that are displayed in a directory listing.  
  160.  
  161.           D    Limit files to a date range -> value format [mm/dd/yy]
  162.           N    Limit files to a name range -> value format [string]
  163.           S    Limit files to a size range -> value format [0]
  164.           T    Limit files to a time range -> value format [hh:mm]
  165.  
  166.           G    Show files greater than value
  167.           GE   Show files greater than or equal to value
  168.           E    Show files equal to value
  169.           LE   Show files less than or equal to value
  170.           L    Show files less than value
  171.  
  172. EXAMPLES:
  173.           
  174.      CDIR /RDG 06/01/94
  175.  
  176.           Will display all files that have a last write date greater than
  177.           06/01/1994
  178.  
  179.      CDIR /RNLE CDIR
  180.  
  181.           Will display all files that have a name less than or equal to CDIR
  182.           NOTE: This function does not support wild cards
  183.  
  184.      CDIR /RSE 1000
  185.  
  186.           Will display all files that have a file size of 1000 bytes.
  187.  
  188.      CDIR /RTL 16:40
  189.  
  190.           Will display all files that have a last write time of 4:40pm
  191.  
  192.  
  193. SYNTAX:   /S
  194.  
  195. USAGE:    Recurse subdirectories, showing the contents of all subdirectories
  196.           from the current directory or [drive:[path]] down.
  197.  
  198.  
  199. SYNTAX:   /V
  200.  
  201. USAGE:    Shows additional information about your command line options.  It
  202.           will notify you of all of the options that are in effect.
  203.  
  204.  
  205. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 5
  206.  
  207.  
  208. [options] continued ...
  209.  
  210.  
  211. SYNTAX:   /X [file pattern]
  212.  
  213. USAGE:    Excludes files from the directory listing.  You can specify any valid
  214.           file pattern including wild cards.  Any file meeting the pattern will
  215.           be excluded.
  216.  
  217. EXAMPLES:
  218.  
  219.      CDIR /X *.EXE
  220.           
  221.           Will exclude all files with the EXE extension
  222.  
  223.  
  224. SYNTAX:   /2
  225.  
  226. USAGE:    Shows the directory listing in 2 columns on an 80 column display and
  227.           will display in as many columns as the screen will allow in any other
  228.           screen mode.  The information that will be displayed, will the be
  229.           same information that would be shown with the OS/2 DIR command.
  230.  
  231.  
  232. SYNTAX:   /3
  233.  
  234. USAGE:    will display the directory listing in 3 columns on an 80 column
  235.           display and will display in as many columns as the screen will allow
  236.           in any other screen mode.  The information that will be displayed is
  237.           the file name and file size.
  238.  
  239.  
  240. A Note about redirecting output from CDIR/2
  241. -------------------------------------------
  242.  
  243. CDIR/2 will be notified when you specify a command that redirects output to
  244. either a file or another program through any of the standard redirection
  245. commands (>, >>, and |).  When CDIR/2 detects that redirection is taking place,
  246. it will disable color output and the pause function.
  247.  
  248.  
  249. CDIR2 Environment variable
  250. --------------------------
  251.  
  252. The CDIR2 environment variable will allow you to specify a path other than the 
  253. location of CDIR2.EXE as the location of CDIR.CFG.  It will also allow you to
  254. specify a filename other than CDIR.CFG.  Just place
  255.  
  256.      SET CDIR2=[drive]:\[directory]\[filename]
  257.  
  258. in your config.sys.
  259.  
  260.  
  261. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 6
  262.  
  263.  
  264. How do I read the CDIR2 directory listing?
  265. ------------------------------------------
  266.  
  267. Default listing format:
  268. -----------------------
  269.    1            2      3       4      5     6
  270. CDIR2.EXE     12345 12345 05-02-93 01:00a AHRS
  271.  
  272. 1 is the files name
  273.  
  274. 2 is the files size, for directory entries <DIR> will replace this number.
  275.  
  276. 3 is the size of this files Extended Attribute
  277.  
  278. 4 is the files last file write date
  279.  
  280. 5 is the files last file write time, where: 
  281.      'a' represents am 
  282.      'p' represents pm
  283.  
  284. 6 shows the current file attributes, where:
  285.      'A' represents Archive 
  286.      'H' represents Hidden 
  287.      'R' represents Read Only 
  288.      'S' represents System 
  289.      '-' would represent that that attribute is not set to on for that file
  290.  
  291.  
  292. Long filename format (/N):
  293. --------------------------
  294.   1      2       3     4     5       6
  295. 12345 05-02-93 01:00a AHRS 12345 CDIR2.EXE
  296.  
  297. 1 is the files size, for directory entries <DIR> will replace this number.
  298.  
  299. 2 is the files last file write date
  300.  
  301. 3 is the files last file write time, where: 
  302.      'a' represents am 
  303.      'p' represents pm
  304.  
  305. 4 shows the current file attributes, where:
  306.      'A' represents Archive 
  307.      'H' represents Hidden 
  308.      'R' represents Read Only 
  309.      'S' represents System 
  310.      '-' would represent that that attribute is not set to on for that file
  311.  
  312. 5 is the size of this files Extended Attribute
  313.  
  314. 6 is the files name
  315.  
  316.  
  317. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 7
  318.  
  319.  
  320. What should I know about the CDIR2.CFG configuration file?
  321. ----------------------------------------------------------
  322.  
  323. There are 4 components to the configuration file.  There are definitions, which
  324. are used to define colors for easier reading of the configuration file.  To
  325. define a color you just need to add a # before a word and then follow that by
  326. a space and a numeric value between 0 and 255.  The next component is the $
  327. command.  There are 3 $ commands: $OPTIONS, $COLOR, and $DIRECTORY which are
  328. described below.  Next there are the string identifiers.  This is the string
  329. that CDIR2 uses to identify a color sequence to use to display that file entry. 
  330. And finally there are comments, which are added by placing a ; anywhere on a new
  331. line or after one of the other commands.  A sample configuration file is
  332. included at the end of this document.  This configuration file needs to reside
  333. in the same directory as CDIR2.EXE.
  334.  
  335. Please Note:  The configuration file is read from top to bottom only once, so
  336. you must declare any # variable before you use them or you will be notified of
  337. an error.
  338.  
  339.  
  340. What does the # command do?
  341. ---------------------------
  342.  
  343. The configuration file comes with all of the colors predefined using the #
  344. command.  If you want to be able to mix your own colors or define new names for
  345. colors you can.  If you want to be able to have a color like blinking red, do
  346. this:  
  347.  
  348.      #BlinkRed RED + BLINK 
  349.  
  350. Only the space between #BlinkRed and RED is required.  Also at this time only
  351. addition is supported when defining colors to use.  You can use this addition
  352. method for any color definition parameter in the configuration file
  353.  
  354.  
  355. What are the $ Commands?
  356. ------------------------
  357.  
  358. $OPTIONS   --  allows you to define what options you want on at all times.
  359.  
  360.      $OPTIONS   /p /v
  361.  
  362. $COLOR     --  allows you to define the default colors to use.
  363.  
  364.      $COLOR     LIGHTGRAY, BLACK
  365.  
  366. $DIRECTORY --  allows you to define the default colors to use for directory
  367.                entries.
  368.  
  369.      $DIRECTORY WHITE, BLACK
  370.  
  371. Note:     If you do not like using # variables you can always use numbers in
  372.           their place for any setting.
  373.  
  374.  
  375. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 8
  376.  
  377.  
  378. How do I define the Colors CDIR/2 should use?
  379. ---------------------------------------------
  380.  
  381. There are two separate ways to define what colors files will appear in.  If a
  382. period '.' is the first character then it is assumed that for all occurrences
  383. of files with that extension that color will be used.  If any other character
  384. is first it will be assumed that for all occurrences of the string, the color
  385. you define will be used.  This option will be overridden by the color set for
  386. the extension.
  387.  
  388. .EXE WHITE, BLUE
  389. CDIR YELLOW, BLUE
  390. .DIZ RED+BLINK, BLACK
  391.  
  392. If we were to use the files that came in the CDIR2.ZIP file the following would
  393. be a description of the output.
  394.  
  395. CDIR2.EXE would appear in WHITE on a BLUE background.
  396. CDIR2.CFG and CDIR.DOC would appear in YELLOW on a BLUE background.
  397. FILE_ID.DIZ would appear in BLINKing RED on a BLACK background.
  398.  
  399.  
  400. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                          Page 9
  401.  
  402.  
  403. This is shareware
  404. -----------------
  405.  
  406. CDIR2 is shareware and as such a monetary contribution of $5 would be greatly
  407. appreciated.  If you do not feel that a contribution is appropriate, but you do
  408. like the program, would you please send me a post card letting me know where
  409. CDIR2 has made it to.  Thank you for all of the people that have contacted me.
  410.  
  411.  
  412. Warranties
  413. ----------
  414.  
  415. The author is not responsible for any problems occurring because of the use or
  416. misuse of this program.  It is the user's responsibility to be aware of the
  417. limitations of this program, whether documented here or not.  This program is
  418. not crippled in any way and you may freely copy this program and give it to your
  419. friends.
  420.  
  421.  
  422. Contacting the Author
  423. ---------------------
  424.  
  425. There are two ways that you can let me know that you like this program.  The
  426. first is to just send a post card to me at the below address.  If you find the
  427. program useful and would like to help finance future programs like this I would
  428. appreciate a contribution of $5.00.  You can send your post card or the
  429. contribution to:
  430.  
  431.                     Dale Couch
  432.                     5124 Conroy Road Suite 625
  433.                     Orlando, FL  32811-3739
  434.  
  435. If you would prefer to just send me an electronic message I can be reached
  436. though any of the following mediums:
  437.  
  438.      Compuserve @ Dale Couch 72622,3636
  439.      Internet   @ 72622.3636@compuserve.com
  440.      RIME       @ ->TREASURE
  441.  
  442. Please feel free to make suggestions or notify me of any problems that you might
  443. find.
  444.  
  445.  
  446. Credits
  447. -------
  448.  
  449. Finally, I have a few credits to give.  First, I would like to thank my father
  450. for acting as a concept sounding board, and having a knack for finding the
  451. perfect piece of code.  I would also like to thank Ryan Smith for helping me to
  452. start and debug this project.
  453.  
  454.  
  455. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                         Page 10
  456.  
  457.  
  458. Other Products
  459. --------------
  460.  
  461. CDIR
  462. ----
  463. There is also a DOS version of CDIR/2.  CDIR shares all of the functions that
  464. the OS/2 version does as well as the ability to share the same .CFG file.
  465.  
  466.  
  467. Syncit and Syncit/2 (Comming Soon)
  468. ----------------------------------
  469. Syncit has been designed to compare the contents of directories or entire
  470. drives, for those of you who maintain copies of files on other media.  This is
  471. also a perfect product for those people who need to constantly update a group
  472. of network drives.  It will compare all filenames, file sizes, file date, and
  473. even their attributes and report on any files that do not match.  This product
  474. will be available for DOS and OS/2 2.x
  475.  
  476.  
  477. Cdel and Cdel/2 (Comming Soon)
  478. ------------------------------
  479. All of the power of CDIR has been transferred into a program that will delete
  480. files.  This program will delete all of the files meeting the conditions that
  481. you specify and will even remove directories if they are empty.  This product
  482. will be available for DOS and OS/2 2.x
  483.  
  484.  
  485. Ccopy and Ccopy/2 (Comming Soon)
  486. --------------------------------
  487. All of the power of CDIR has been transferred into a program that will copy or
  488. move files.  It will work the same as XCOPY and have the added feature of a MODE
  489. command.  This product will be available for DOS and OS/2 2.x
  490.  
  491.  
  492. CDIR/2 v1.50 (OS/2) Copyright 1994 by Dale Couch                         Page 11
  493.  
  494.  
  495. ;
  496. ; This is a sample configuration file for CDIR2.  Just copy the
  497. ; contents of this page to the file CDIR2.CFG, if you are missing
  498. ; the original .CFG file.
  499. ;
  500. #BLACK        0
  501. #BLUE         1
  502. #GREEN        2
  503. #CYAN         3
  504. #RED          4
  505. #MAGENTA      5
  506. #BROWN        6
  507. #LIGHTGRAY    7
  508. #DARKGRAY     8
  509. #LIGHTBLUE    9
  510. #LIGHTGREEN   10
  511. #LIGHTCYAN    11
  512. #LIGHTRED     12
  513. #LIGHTMAGENTA 13
  514. #YELLOW       14
  515. #WHITE        15
  516. #BLINK        128
  517. ;
  518. ; DEFAULT Program settings
  519. ;
  520. $OPTIONS   /p /v            ; pause after each page and use verbose mode
  521. $COLOR     LIGHTGRAY, BLACK ; default text to white on black
  522. $DIRECTORY LIGHTGRAY,BLACK  ; default dir entries to white on black
  523. ;
  524. ; Begin Color Text definitions
  525. ;
  526. .EXE WHITE,  BLUE           ; Comment after definition
  527. CDIR YELLOW, BLUE
  528. .DIZ RED+BLINK, BLACK