Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dirent(4) — GL2 W3.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getdents(2)

DIRENT(4)  —  Silicon Graphics

NAME

dirent − file system independent directory entry

SYNOPSIS

#include <sys/types.h>
#include <sys/dirent.h>

DESCRIPTION

Different file system types may have different directory entries.  The dirent structure defines a file system independent directory entry, which contains information common to directory entries in different file system types.  A set of these structures is returned by the getdents(2) system call.

The dirent structure is defined below. 

structdirent {
longd_ino;
off_td_off;
unsigned shortd_reclen;
chard_name[1];
};

The d_ino is a number which is unique for each file in the file system.  The field d_off is an opaque offset (i.e., not necessarily in bytes) of the next directory entry in the actual file system directory.  The field d_name is the beginning of the character array giving the name of the directory entry.  This name is null terminated and may have at most ­MAXNAMLEN characters.  This results in file system independent directory entries being variable length entities.  The value of d_reclen is the record length of this entry.  This length is defined to be the number of bytes between the current entry and the next one, so that it will always result in the next entry being on a long boundary. 

SEE ALSO

getdents(2). 

Version 3.6  —  December 20, 1987

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