File:  [Research Unix] / researchv10dc / man / man5 / dir.5
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

.TH DIR 5
.CT 1 dirs
.SH NAME
dir \- format of directories
.SH SYNOPSIS
.B #include <sys/types.h>
.br
.B #include <sys/dir.h>
.SH DESCRIPTION
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 inode entry;
see
.IR filsys (5).
The structure of a directory entry as given in the
include file is:
.IP
.EX
.ta \w'ifndef  'u +\w'DIRSIZ  'u
#define	DIRSIZ	14
struct	direct
{
	ino_t	d_ino;
	char	d_name[DIRSIZ];
};
.EE
.PP
By convention, the first two entries in each directory
are
.L .
for the directory itself and
.L ..
for the parent
directory.
In the ultimate root directory
.L ..
is the same as
.LR . .
.PP
It is inadvisable to read directories using this structure.
The routines in
.IR directory (3)
and
.IR dirread (2)
are more efficient and portable.
.SH "SEE ALSO"
.IR filsys (5), 
.IR directory (3),
.IR dirread (2)


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.