Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dir(4) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fs(4)

directory(3C)

DIR(4)  —  HP-UX

NAME

dir − format of directories on short-name HFS file systems

SYNOPSIS

#include <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 <ndir.h>, which describes a format identical to that used in an HFS file system supporting long file names of up to 255 bytes in length. 

The direct structure defined in <ndir.h> should be used in conjunction with the directory(3C) library routines for portability to all HP-UX file systems and 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 DIRSIZ14
#define DIRSIZ_CONSTANT14
#define DIR_PADSIZE10
#define MAXNAMLEN255
structdirect {
u_longd_ino;/* inode number of entry */
u_shortd_reclen;/* length of this record */
u_shortd_namlen;/* length of string in d_name */
chard_name[DIRSIZ_CONSTANT];
chard_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 DIRSTRCTSIZ32 /* 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 parent, so .. and . have the same meaning. 

AUTHOR

Dir was developed by AT&T and HP. 

SEE ALSO

fs(4), directory(3C). 

MARKETING MODEL

Level A
Level B
Level C

TECHNICAL MODEL

Core System Base
Industry

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026