C on Directory

vm.cuny.edu vm.cuny.edu
Sun Oct 22 01:05:37 AEST 1989


>From _Advanced_Unix_Programing_ by Marc Rochkind:

A directory has the following structure:

struct direct {
    ino_t  d_ino;
    char   d_name[DIRSIZE + 1]
} dlink;

ino_t and DIRSIZE are declared in "<sys/dir.h>"

Open/Read/Close Dir could be implemented as macros to open a file, read it with
this structure, and close it.

Patrick Spinler
pspinler%mkvax1 at msus1.bitnet



More information about the Comp.unix.wizards mailing list