home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / basw / attrib.txt < prev    next >
Text File  |  1990-10-01  |  2KB  |  53 lines

  1. The following discusses the directory entry.  The directory on a diskette is 7
  2. sectors, or 3,584 bytes.  Each entry in a directory is 32 bytes, which allows
  3. for 112 total directory entries on a diskette. 
  4.  
  5. Each directory entry is 32 bytes long, and consists of the following info: 
  6.  
  7. Byte      Usage 
  8. ----      ----- 
  9.  
  10.  1-8      Filename 
  11.  9-11     Extension 
  12. 12        Attribute 
  13.                8th bit:  Unused in DOS 2.x 
  14.                7th bit:  Unused in DOS 2.x 
  15.                6th bit:  Archive 
  16.                5th bit:  Marks directory entry as being a sub-directory name
  17.                          rather than an ordinary file 
  18.                4th bit:  Marks directory entry as being a Volume ID label 
  19.                3rd bit:  System file 
  20.                2nd bit:  Hidden file 
  21.                1st bit:  Read Only file 
  22. 13-22     Reserved 
  23. 23-24     Time mark 
  24. 25-26     Date mark 
  25. 27-28     Starting cluster 
  26. 29-32     File size 
  27.  
  28.  
  29. I'll now expand upon the ATTRIBUTE byte, which is one of the most flexible bytes
  30. in a directory entry.... 
  31.  
  32. Using the NORTON UTILITIES, some other disk manipulator or DEBUG.COM, if you
  33. look at the 12th of the directory entry of a normal file, it will usually be
  34. either hex 20 or hex 00.  In my chart above, the ATTRIBUTE byte bits are
  35. numbered 1-8, right to left.  Hex 20 in binary is 00100000.  The only bit that
  36. is a "1" in a normal file (hex 20) is, counting right to left, the 6th bit,
  37. which is the Archive bit.  If you were to use BACKUP.COM on this file, then DOS
  38. would flip this 6th bit, and the ATTRIBUTE byte would now be hex 00. 
  39.  
  40. Thus, a hidden file would have its ATTRIBUTE bits look like 00100010, and the
  41. ATTRIBUTE byte would have a value of hex 22.  And similarly, the two system
  42. files, IBMBIO.COM and IBMDOS.COM, have an ATTRIBUTE byte of hex 27, which when
  43. converted to binary is 00100111 (Read Only, Hidden, System and Archive). 
  44.  
  45. If you have a Volume Label ID on your diskette, and if you looked at its
  46. ATTRIBUTE byte, you would find its value to be hex 28 (00101000).  If you look
  47. at a sub-directory name, it will have a value of hex 30 (00110000). 
  48.  
  49. Now this is where the playing around begins......If you take a sub-directory
  50. name and flip the "hidden" bit, i.e., make it 00110010, or hex 32, then it
  51. becomes a hidden sub-directory.  A DIR would not show it, but you could still do
  52. a Change Directory to it, providing you know the name. 
  53.