HPUX dir[4]

dir(4) dir(4)
NAME
dir - format of directories on short-name HFS file systems
SYNOPSIS
#include <sys/types.h>
#include <sys/dir.h>
REMARKS
This entry describes the System V-compatible directory format for the
HFS file system. It is provided strictly for backward compatibility
and compatibility with applications expecting a System V file system
environment. It is not compatible with the similar but more general
HFS directory format in <dirent.h>, which describes a format identical
to that used in an HFS file system supporting long file names up to
255 bytes in length.
The dirent structure defined in <dirent.h> should be used in
conjunction with the directory(3C) routines for portability to other
industry UNIX implementations.
DESCRIPTION
A directory behaves exactly like an ordinary file, except that no user
can 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 fs(4)).
The structure of a directory entry as given in the <sys/dir.h> header
file is:
#define DIRSIZ 14
#define DIRSIZ_CONSTANT 14
#define DIR_PADSIZE 10
#define MAXNAMLEN 255
struct direct {
u_long d_ino; /* inode number of entry */
u_short d_reclen; /* length of this record */
u_short d_namlen; /* length of string in d_name */
char d_name[DIRSIZ_CONSTANT];
char d_pad[DIR_PADSIZE];
};
/*
* DIRSTRCTSIZ is the number of bytes in the structure
* representing a System V-compatible (14-character
* maximum file name length) HFS directory entry.
*/
#define DIRSTRCTSIZ 32 /* sizeof(struct direct) */
By convention, the first two entries in each directory are for . and
.. (``dot'' and ``dot dot''). The first is an entry for the directory
itself. The second is for the parent directory. The meaning of .. is
modified for the root directory of the master file system; there is no
Hewlett-Packard Company - 1 - HP-UX Release 9.0: August 1992
dir(4) dir(4)
parent, so .. and . have the same meaning.
AUTHOR
dir was developed by AT&T and HP.
SEE ALSO
fs(4), directory(3C).
Hewlett-Packard Company - 2 - HP-UX Release 9.0: August 1992