home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!emory!wupost!cs.utexas.edu!sun-barr!ames!agate!ucbvax!EQL.CALTECH.EDU!rankin
- From: rankin@EQL.CALTECH.EDU (Pat Rankin)
- Newsgroups: comp.os.vms
- Subject: record format for directory files
- Message-ID: <921112192340.21c151eb@EQL.Caltech.Edu>
- Date: 13 Nov 92 03:34:16 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 40
-
- > 1- I loaded a FOO.DIR file into TPU and looked at it. It contains all
- > the filenames in the directory FOO, plus some other information. I am
- > assuming this information is date/time, size, location on disk, etc.
- > for each file in that directory. Does anyone know what is the format
- > for the records in FOO.DIR directory ?
-
- No, the extra stuff in those directory entries does not correspond
- to any of that type of data. There is one record per filename (*). It
- contains a record length (2 bytes used by RMS for all variable length
- records), a version limit (2 bytes; 32767 is the default and means no
- limit is enforced), a flags byte, a length byte 'n', then 'n' characters
- of the filename (name.type, including the period delimiter), then a NUL
- padding byte if 'n' happens to be odd, followed by 1 or more pairs of
- binary values: version number (2 bytes) and file ID number (6 bytes).
- Each name is stored only once (*); when multiple versions of a file are
- present, only the version number and file ID is kept for the extra entries
- of that file name, ordered from high to low. The number of versions
- present is derivable from the record length and filename length.
-
- A file ID number is used to compute an index into [000000]INDEXF.SYS
- for that disk. That file contains file headers, which is where ownership,
- protection, and creation/modification/backup/expiration dates are stored,
- along with list of which disk blocks are allocated to each particular file.
- You can use ``DUMP/HEADER/BLOCK=COUNT=0 foo.bar'' to get a formatted list
- of a file's header (/block=count=0 is used to suppress getting the actual
- blocks of the file formatted along with it; /record=count=0 would work too).
- You can obtain that data in a program by using SYS$QIO[W] (see chapter 1
- in the _I/O_User's_Reference_Manual,_Part_I_); it's rather complicated.
-
- (*) There is an exception to the one record per filename rule when
- that name has so many versions that its <version,file-ID> pairs can't fit
- within a single disk block. For performance reasons, directory records
- are not allowed to cross block boundaries. Large number of file versions
- results in multiple records with bits in the flags-byte indicating whether
- any given record is preceded and/or followed by another record for the
- same filename. What constitutes "large number of versions" depends on
- the length of the filename involved.
-
- Pat Rankin, rankin@eql.caltech.edu
-
-