home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #3.1
/
RBBSIABOX31.cdr
/
basw
/
attrib.txt
< prev
next >
Wrap
Text File
|
1990-10-01
|
2KB
|
53 lines
The following discusses the directory entry. The directory on a diskette is 7
sectors, or 3,584 bytes. Each entry in a directory is 32 bytes, which allows
for 112 total directory entries on a diskette.
Each directory entry is 32 bytes long, and consists of the following info:
Byte Usage
---- -----
1-8 Filename
9-11 Extension
12 Attribute
8th bit: Unused in DOS 2.x
7th bit: Unused in DOS 2.x
6th bit: Archive
5th bit: Marks directory entry as being a sub-directory name
rather than an ordinary file
4th bit: Marks directory entry as being a Volume ID label
3rd bit: System file
2nd bit: Hidden file
1st bit: Read Only file
13-22 Reserved
23-24 Time mark
25-26 Date mark
27-28 Starting cluster
29-32 File size
I'll now expand upon the ATTRIBUTE byte, which is one of the most flexible bytes
in a directory entry....
Using the NORTON UTILITIES, some other disk manipulator or DEBUG.COM, if you
look at the 12th of the directory entry of a normal file, it will usually be
either hex 20 or hex 00. In my chart above, the ATTRIBUTE byte bits are
numbered 1-8, right to left. Hex 20 in binary is 00100000. The only bit that
is a "1" in a normal file (hex 20) is, counting right to left, the 6th bit,
which is the Archive bit. If you were to use BACKUP.COM on this file, then DOS
would flip this 6th bit, and the ATTRIBUTE byte would now be hex 00.
Thus, a hidden file would have its ATTRIBUTE bits look like 00100010, and the
ATTRIBUTE byte would have a value of hex 22. And similarly, the two system
files, IBMBIO.COM and IBMDOS.COM, have an ATTRIBUTE byte of hex 27, which when
converted to binary is 00100111 (Read Only, Hidden, System and Archive).
If you have a Volume Label ID on your diskette, and if you looked at its
ATTRIBUTE byte, you would find its value to be hex 28 (00101000). If you look
at a sub-directory name, it will have a value of hex 30 (00110000).
Now this is where the playing around begins......If you take a sub-directory
name and flip the "hidden" bit, i.e., make it 00110010, or hex 32, then it
becomes a hidden sub-directory. A DIR would not show it, but you could still do
a Change Directory to it, providing you know the name.