.TH DIR 5 "15 January 1983"
dir \- format of directories
.B #include <sys/types.h>
A directory behaves exactly like an ordinary file, save that no
user may write into a directory.
The fact that a file is a directory is indicated by
a bit in the flag word of its i-node entry; see
The structure of a directory entry as given in the include file is:
* This sets the "page size" for directories.
* Requirements are DEV_BSIZE <= DIRBLKSIZ <= MINBSIZE with
* DIRBLKSIZ a power of two.
* Dennis Ritchie feels that directory pages should be atomic
* operations to the disk, so we use DEV_BSIZE.
#define DIRBLKSIZ DEV_BSIZE
* This limits the directory name length. Its main constraint
* is that it appears twice in the user structure. (u. area)
char d_name[MAXNAMLEN + 1];
By convention, the first two entries in each directory
are for `\fB.\fR' and `\fB..\fR'. The first is an entry for the
directory itself. The second is for the parent directory.
The meaning of `\fB..\fR' is modified for the root directory
of the master file system
where `\fB..\fR' has the same meaning as `\fB.\fR'.