home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / dircomp.zip / dircomp.inf (.txt) < prev   
OS/2 Help File  |  1999-05-25  |  12KB  |  252 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. DIRCOMP is a command line utility which allows you to compare two directories 
  5. and check if there are files that do not match. This may be of importance if 
  6. you have to maintain both a network volume and a local drive on which files 
  7. have to be the same. It may also be suited for incomplete backups to see which 
  8. files did not make it into the backup. 
  9.  
  10. In contrast to contemporary "fashion" this program was designed as character 
  11. mode application mainly because: 
  12.  
  13.  Γûá the programmer is not familiar with PM programming. 
  14.  
  15.  Γûá typical users of the application dislike use of the mouse. 
  16.  
  17.  Γûá output can be redirected to NUL. 
  18.  
  19. The entire project is a result of private research of the programmer to get 
  20. acquainted with programming of OS/2-API. Therefore, this utility comes to you 
  21. as freeware with the author hoping to give you a reliable and fast utility to 
  22. work with. It has to be mentioned that there is already a powerful tool to 
  23. compare directories, delivered by COOLWARE. So in case you are dissatisfied 
  24. with this application you should try PMDIRENF which offers several functions 
  25. more and which is freeware, too. 
  26.  
  27. No further development of the product is intended, except elimination of bugs 
  28. that may still wait for detection. First it was planned to bring out a version 
  29. out for Windows NT but such kind of utility is supplied with the Resource Kit. 
  30.  
  31.  
  32. ΓòÉΓòÉΓòÉ 2. How to invoke DIRCOMP ΓòÉΓòÉΓòÉ
  33.  
  34. At command line prompt type in: 
  35.  
  36. DIRCOMP [options] [directory][file pattern] [directory] 
  37.  
  38. and the utility will list all mismatches of the two designated directories. 
  39.  
  40. Normally, you enter something like this: 
  41.  
  42. dircomp *.exe d:\os2 
  43.  
  44. Implicitly you want to compare all executables in your actual directory with 
  45. all executables that reside in directory OS2 of drive D. 
  46. In case you only enter a directory name, DIRCOMP selects all files, i.e. all 
  47. files matching '*'. 
  48.  
  49.  
  50. ΓòÉΓòÉΓòÉ 2.1. Options ΓòÉΓòÉΓòÉ
  51.  
  52. Options for DIRCOMP are quite similar to those of the built-in-command DIR of 
  53. CMD.EXE which means that you can select attributes of the files you want to 
  54. match. Options must start with a slash character followed by at least one 
  55. letter. Unlike command-line utilities based on UNIX-systems, DIRCOMP does not 
  56. support the dash character since the file pattern to be matched may start with 
  57. such a character, e.g. "-dash*.txt". Since it is default for OS/2 command line 
  58. programs, options do not have to be typed in before arguments to the program, 
  59. e.g., you give the command: 
  60.  
  61. dircomp *.exe /a:r d:\os2 /p 
  62.  
  63. Options available are: 
  64. /? 
  65. /A[ADHRS] 
  66. /B 
  67. /L 
  68. /P 
  69. /S 
  70. /T 
  71.  
  72. Note that ordering of files is not implemented. See Programmer's Perspective 
  73. for details. 
  74.  
  75.  
  76. ΓòÉΓòÉΓòÉ 2.2. Output ΓòÉΓòÉΓòÉ
  77.  
  78. DIRCOMP lists those files that either differ from each other in last-access 
  79. date, last-access time or size or non-existence on either of the two designated 
  80. directories. It does not list the actual directory nor the directory above. 
  81. For example: You typed in DIRCOMP D: M: /A-D , you could get: 
  82. D:\* M:\* 
  83. 10.04.96 23:37:12  3935    0    CONFIG.001   LLL
  84. 09.04.96 21:21:10  4338    0    CONFIG.BAK   LLL
  85. 27.04.96 00:23:26  4342    0    CONFIG.SYS   LLL 10.04.96 23:37:12  3935     0 
  86. CONFIG.SYS 
  87. 10.04.96 21:58:14  1462272  0    EA DATA. SF   LLL
  88. 22.04.96 14:09:24  76     35   STARTUP.CMD   RRR 04.06.96 22:00:06  111     0 
  89. STARTUP.CMD 
  90. 04.06.96 21:40:24  271    0    WP ROOT. SF   LLL 12.05.96 20:37:02  271     0 
  91. WP ROOT. SF 
  92.  
  93.  
  94. ΓòÉΓòÉΓòÉ 3. Programmer's Perspective ΓòÉΓòÉΓòÉ
  95.  
  96. DIRCOMP has been designed as a kind of study how to combine both multithreading 
  97. and recursion in a single program. As it has been said earlier, I wanted to 
  98. know how to handle OS/2 Control Program API. This included semaphores, 
  99. designing threads and perform some error-message handling as well. It would 
  100. have been nice to do PM also, but when I thought of the user, I soon realized 
  101. that a windowed application without use of VIO was the proper solution. It 
  102. should still be usable even if you have to boot from the emergency disks and I 
  103. think that typing in pathnames is much quicker than using file-selector-boxes. 
  104. I looked at PMDIRENF and I felt a little uncomfortable with so many operations 
  105. I could execute when all I wanted was to list all mismatches of dedicated 
  106. directories. 
  107.  
  108. During the development of this tool, I was strongly in favour of creating a 
  109. dual-purpose utility that could have been used as both a directory comparison 
  110. program and a substitute of the existing DIR-command because of the fact that 
  111. DIR has a limitation with respect to ordering (just in case someone does not 
  112. organize well his directory structure and collects a large number of files in a 
  113. single directory - we happened to see such thing). So, I first took effort to 
  114. build an application being as close to the command mentioned above. I 
  115. implemented ordering of file by size etc. and handling of file attributes. 
  116. Instantly, I was very surprised about DosFindFirst's behaviour regarding file 
  117. attributes. Nevertheless, it was low a hurdle to take. After I spent some time 
  118. on ordering, it turned out be irrelevant to my main task: directory comparison. 
  119. So, I did not bother with substituting DIR any longer, and I dropped the 
  120. feature that file entries were displayed in a user-defined ordering. 
  121. Interestingly, as this project had nearly been finished, I got a glance at NT's 
  122. Windiff utility, shipping with the Resource Kit. It works slightly different to 
  123. my program as it also compares the files themselves. This is surely more 
  124. convenient than my method of checking file entries only. Nevertheless, I did 
  125. not improve the program since a differential file compare utility is available 
  126. as part of the GNU project. By the way, I was confirmed in designing DIRCOMP as 
  127. a command line tool. Although Windiff is primarily an application using the 
  128. standard Windows-GUI it can be invoked from command line as well, saving output 
  129. to a file. 
  130.  
  131. Please note that this project was born purely out of curiousity, and the 
  132. underlying algorithm is not to be considered as optimal, just one out of a set 
  133. of possibilities. For those who are interested in performance, I have added the 
  134. timing option /T. 
  135.  
  136. DIRCOMP has been developed using the EMX/GCC v0.9a package with method E3, so 
  137. there is no need for an accompanying DLL, even if this means that the 
  138. executable file increases in size (Ever thought of purchasing a new high 
  139. capacity volume? Disk space is cheap these days). I have to thank all 
  140. contributors to the EMX/GCC development system since it is still my first 
  141. choice, despite of heavy competition from commercial suppliers of compilers 
  142. (including the manufacturer of this operating system). 
  143.  
  144.  
  145. ΓòÉΓòÉΓòÉ 4. Revision Information ΓòÉΓòÉΓòÉ
  146.  
  147.  Version 1.00 - Initial Release in July 1996 
  148.  
  149.  Version 1.01 - Dec 1996, minor corrections applied, public availability May 
  150. 1999 
  151.  
  152.  
  153. ΓòÉΓòÉΓòÉ 5. Disclaimer ΓòÉΓòÉΓòÉ
  154.  
  155. This software is provided "as is" with no warranty. The author makes no 
  156. representation, or warranty, either express or implied, with respect to the 
  157. program, its quality, accuracy, or fitness for a specific purpose. Therefore, 
  158. the author shall have no liability to you or any other person or entity with 
  159. respect to any liability, loss, or damage caused or alleged to have been caused 
  160. directly or indirectly by the program provided. This includes, but is not 
  161. limited to, interruption of service, loss of data, loss of classroom time, loss 
  162. of consulting or anticipatory profits, or consequential damages from the use of 
  163. the program. 
  164.  
  165.  
  166. ΓòÉΓòÉΓòÉ 6. Copyright ΓòÉΓòÉΓòÉ
  167.  
  168. This software is protected by international copyright law, regardless of the 
  169. fact that it is freeware. This means, you are allowed to make copies of the 
  170. files and distribute it. The only restriction is that all files have to be 
  171. distributed together. 
  172.  
  173. (c) 1996, by Axel Meiss 
  174. All rights reserved. 
  175.  
  176.  
  177. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  178.  
  179. This message shall remind you that it is very important to keep backups of your 
  180. files. You don't care? Good luck! 
  181.  
  182.  
  183. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  184.  
  185. OS/2 is a trademark of IBM Corp. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  189.  
  190. Windows NT is a trademark of Microsoft Corp. 
  191.  
  192.  
  193. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  194.  
  195. Coolware 
  196. PO Box 18863 
  197. Atlanta, GA 
  198. 31126 
  199. CompuServe id : 76500,2557. 
  200.  
  201.  
  202. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  203.  
  204. Get a short info on invoking DIRCOMP. 
  205.  
  206.  
  207. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  208.  
  209. Specifying this option means that you want to include/exclude those files which 
  210. do/do not match the given attribute 
  211. Example: 
  212. dircomp *┬╖exe d:\os2 /A:A-R 
  213. all executables in the actual directory and directory OS2 of drive D having the 
  214. attribute ARCHIVE but which have not the READ-ONLY-attribute set. 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  218.  
  219. Displays file names only 
  220.  
  221.  
  222. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  223.  
  224. Displays version information 
  225.  
  226.  
  227. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  228.  
  229. Displays all mismatching file names in lower case. Otherwise, file names will 
  230. be displayed as they were created, i.e. on a HPFS file system cONfiG.sYS 
  231.  
  232.  
  233. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  234.  
  235.  
  236. Waits for a keystroke after one page has been displayed. 
  237.  
  238.  
  239. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  240.  
  241. Want to include subdirectories also? Bingo, you made it! Why not comparing 
  242. complete drives? It's so easy if this option is set 
  243.  
  244.  
  245. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  246.  
  247. Display time of execution in milliseconds 
  248.  
  249.  
  250. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  251.  
  252. Windows is a trademark of Microsoft Corp.