|
|
1.1 root 1: .TH DIR 5
2: .CT 1 dirs
3: .SH NAME
4: dir \- format of directories
5: .SH SYNOPSIS
6: .B #include <sys/types.h>
7: .br
8: .B #include <sys/dir.h>
9: .SH DESCRIPTION
10: A directory
11: behaves exactly like an ordinary file, save that no
12: user may write into a directory.
13: The fact that a file is a directory is indicated by
14: a bit in the flag word of its inode entry;
15: see
16: .IR filsys (5).
17: The structure of a directory entry as given in the
18: include file is:
19: .IP
20: .EX
21: .ta \w'ifndef 'u +\w'DIRSIZ 'u
22: #define DIRSIZ 14
23: struct direct
24: {
25: ino_t d_ino;
26: char d_name[DIRSIZ];
27: };
28: .EE
29: .PP
30: By convention, the first two entries in each directory
31: are
32: .L .
33: for the directory itself and
34: .L ..
35: for the parent
36: directory.
37: In the ultimate root directory
38: .L ..
39: is the same as
40: .LR . .
41: .PP
42: It is inadvisable to read directories using this structure.
43: The routines in
44: .IR directory (3)
45: and
46: .IR dirread (2)
47: are more efficient and portable.
48: .SH "SEE ALSO"
49: .IR filsys (5),
50: .IR directory (3),
51: .IR dirread (2)
52:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.