The file attribute is a 1-byte bit-flag associated with each file, found
in the file's directory entry and used in several DOS functions.
╙─┴─┴╥┴╥┴╥┴╥┴╥┴╥╜ bit mask
║ ║ ║ ║ ║ ╚═► 0: 01H 1=Read-only (file can't be written/deleted)
║ ║ ║ ║ ╚═══► 1: 02H 1=Hidden
║ ║ ║ ╚═════► 2: 04H 1=System
║ ║ ╚═══════► 3: 08H 1=Volume label entry
║ ╚═════════► 4: 10H 1=subDirectory entry
╚═══════════► 5: 20H Archive bit. 1=file has NOT been backed up
Some Commonly-Seen File Attributes
0 a normal file
3 read-only, hidden, and system (used in system files)
8 the volume label entry (should be found only in the root directory)
10H a directory
20H a normal file which has not been backed up by BACKUP or XCOPY
DOS Fn 11H and 4eH directory searches are inclusive. You can set one or
more of the file attribute bits for Hidden, System, Directory, and
Archive if you want to search for files with one or more of these
attributes. When a bit is clear, files that have that attribute will NOT
For instance, if you want to locate directory entries only, you can use an
attribute of 10H to obtain a set of all files including directories, then
ignore all the entries that are not directories (having bit 4=0).
If you specify an attribute with the Volume bit, the search will be
exclusive, returning only the entry of the volume label (if any).
DOS Fn 43H (set file attribute) will let you set or clear the Read-only,
Hidden, System, and Archive bits. You cannot alter the Directory
attribute bit, but you can add or remove other bits of the directory's
attribute by specifying an attribute having all the desired bits for the
directory EXCEPT bit 4.
See Also: Directory and File Functions