home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / dirutl / ca13.arc / CA.DOC < prev   
Encoding:
Text File  |  1989-10-21  |  4.6 KB  |  138 lines

  1.  
  2. CA.COM by Mark Adler  Pasadena, CA  1988,1989.
  3.  
  4.  
  5. CA is a command used to change and examine file attributes.  Entering
  6. just:
  7.  
  8.      ca
  9.  
  10. may give a display like:
  11.  
  12.      *.*
  13.        rhy- ibmbio.com
  14.        rhy- ibmdos.com
  15.        r--- command.com
  16.        ---m config.sys
  17.        ---m autoexec.bat
  18.  
  19. which is a list of files in the root directory and their attributes.
  20. The first column of attributes is either '-' or 'r' for read/write or
  21. read/only.  The second column is either '-' or 'h' for visible or
  22. hidden.  The third column is '-' or 'y' for typical or system, and the
  23. fourth column is '-' or 'm' for backed-up or modified.
  24.  
  25. To change attributes, there are eight options to set each of the four
  26. attribute bits to their possible values.  For example, the command:
  27.  
  28.      ca/b
  29.  
  30. would try to change all the files in the current directory to the
  31. backed-up status and would display, for the example directory above:
  32.  
  33.       changed config.sys
  34.       changed autoexec.bat
  35.      2 files' attributes changed
  36.  
  37. Note that CA only changed the files that needed to be changed.  See
  38. below for a complete listing of the options.
  39.  
  40. CA can take file names to narrow down what is changed.  For example:
  41.  
  42.      ca/vt *.com
  43.  
  44. will make all the .COM files visible and typical, so for the above
  45. directory, the system files IBMBIO.COM and IBMDOS.COM would show up in
  46. the normal directory listing.
  47.  
  48. CA can also perform these operations to all the files contained in a
  49. subdirectory and its subsubdirectories, etc.  The option for this is
  50. "/S":
  51.  
  52.      ca/sr \dos
  53.  
  54. will make all the files in \DOS read-only.
  55.  
  56. Alternatively, CA can change all the files that match a particular name,
  57. but in all the subdirectories.  The option for this is "/F" (find):
  58.  
  59.      ca/fr \*.exe
  60.  
  61. will make all the .EXE files on the current drive read/only, no matter
  62. where they are.
  63.  
  64. CA can prompt you before changing the attribute of each file.  For
  65. example:
  66.  
  67.      ca/pb *.*
  68.  
  69. will, for each file in the current directory that has been modified
  70. since the last backup, ask youif it should change the modified bit or
  71. not:
  72.  
  73.      Change file foo.c (y/n)? _
  74.  
  75. You must then answer y, n, Y, or N.  Any other response is ignored.
  76.  
  77. CA takes options that are preceded by a slash (/).  The command line is
  78. read from left to right, processing options and file/path names as they
  79. appear.  However, options that are appended to a file/path name take
  80. effect before that name is processed.  For example, this command would
  81. do the same thing as "ca/r *.exe":
  82.  
  83.      ca *.exe/r
  84.  
  85. But the command "ca *.exe /r" (notice the extra space before the /r)
  86. would not do the same thing.  In this case, CA notices the "dangling"
  87. option before it does anything and simply ignores the entire command for
  88. safety, printing:
  89.  
  90.     Dangling option---entire command ignored
  91.  
  92. Since there are options to change the defaults along a command line,
  93. there are options to change them back for processing the next thing
  94. on the command line.  All the options are listed here:
  95.  
  96.      /R  - Change attribute to read-only.
  97.      /W  - Change attribute to read-write.
  98.      /H  - Change attribute to hidden.
  99.      /V  - Change attribute to visible.
  100.      /Y  - Change attribute to system.
  101.      /T  - Change attribute to typical.
  102.      /M  - Change attribute to modified.
  103.      /B  - Change attribute to backed-up.
  104.      /L  - No change---just list files and their attributes (default).
  105.      /S  - Include matching subdirectories and all of their contents.
  106.      /N  - Ignore subdirectories (default).
  107.      /F  - Include all files that match pattern in all subdirs.
  108.      /A  - Include all files in subdirectories, period (default).
  109.      /P  - Prompt for each deletion or removal.
  110.      /Q  - Quiet---don't prompt (default).
  111.      /?  - Display version number and list of options.
  112.  
  113. A complicated example of CA is:
  114.  
  115.      ca /frp \*.com \*.exe /l \*.com \*.exe
  116.  
  117. which prompts to change all the .COM and .EXE files on the current drive
  118. to read-only and then lists all the .COM and .EXE files on the current
  119. drive along with their (possibly new) attributes.  The /L turns off the
  120. change turned on by the /R.  The /P is ignored when listing, so it was
  121. not necessary to turn that off with /Q.
  122.  
  123.  
  124. Version history -
  125.  
  126. 1.0      5 Jun 1988     First public version
  127. 1.1     18 Nov 1988     Fixed for Turbo C 2.0 (label needs statement)
  128. 1.2      3 Feb 1989     Display files and directories in lower case
  129. 1.3     21 Oct 1989     Catch dangling options and ignore command
  130.  
  131.  
  132. Feel free to send any problems with or comments on CA.COM to:
  133.  
  134.         Mark Adler
  135.         P.O. Box 60998
  136.         Pasadena, CA  91116
  137.  
  138.