home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / dosc / dos_dir.txt < prev    next >
Encoding:
Text File  |  1984-12-01  |  1.8 KB  |  70 lines

  1. Data Structure      -    MS-DOS Directory Entry
  2.  
  3.  
  4. 12.01.84 - cbradley - from "Disk Operating System" (IBM Corp.)
  5.  
  6.  
  7. The basic directory area for all types of disks is constructed by the FORMAT
  8. utility.  The directory's location is available through the device driver
  9. interfaces as a logical sector number.
  10.  
  11.  
  12.  
  13. MS-DOS directory entries are 32 bytes in length, in the following format:
  14.  
  15.  
  16. Byte Offset    Description
  17.  
  18. 0-7        Filename (text) - byte 0 indicates the file status
  19.  
  20.             byte 0 == 00    ->    never been used
  21.             byte 0 == E5    ->    was used, now deleted
  22.             byte 0 == 2E    ->    is a subdirectory
  23.             byte 0 == anything else is char 0 of the filename
  24.  
  25. 8-10        Filename extension
  26.  
  27. 11        File attribute.  Mapped as follows:
  28.  
  29.             01 -> read-only     02 -> hidden file
  30.             04 -> system file    08 -> volume label
  31.             10 -> is sub-dir    20 -> Archive bit
  32.  
  33. 12-21        Reserved.
  34.  
  35. 22-23        Time-stamp of file creation or update.    Time is mapped into bits
  36.         as shown below:
  37.  
  38.             <      hh     >    <    mm    >    <   xx  >
  39.              15 14 13 12 11    10 9 8 7 6 5    4 3 2 1 0
  40.  
  41.         where:
  42.  
  43.              hh == binary number of hrs (0-23)
  44.  
  45.              mm == binary number of mins (0-59)
  46.  
  47.              xx == binary number of TWO-SECOND increments
  48.  
  49.  
  50. 24-25        Date-stamp of file creation or update.    Bits are mapped as
  51.         follows:
  52.  
  53.             <     25        >         <       24       >
  54.             15 14 13 12 11 10 9 8         7 6 5 4 3 2 1 0
  55.             y  y  y  y  y  y  y m         m m m d d d d d
  56.  
  57.         where:
  58.  
  59.             m == 1-12
  60.             d == 1-31
  61.             y == 0-119  (1980 to 2099)
  62.  
  63.  
  64. 26-27        Starting cluster number in FAT of file - the relative cluster
  65.         number of the first cluster of disk belonging to the file
  66.  
  67.  
  68. 28-31        File size in bytes.  First word contains low-order part of the
  69.         size figure.  Both words are stored with the LSB first.
  70.