Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dir_ufs(4) — NEWS-os 5.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fs(4)



dir(4)                    FILE FORMATS                     dir(4)



NAME
     dir (ufs) - format of ufs directories

SYNOPSIS
     #include <sys/param.h>
     #include <sys/types.h>
     #include <sys/fs/ufsfsdir.h>

DESCRIPTION
     A directory consists of some number of blocks  of  DIRBLKSIZ
     bytes,  where  DIRBLKSIZ  is  chosen  such  that  it  can be
     transferred to disk in a single atomic operation  (e.g.  512
     bytes on most machines).

     Each DIRBLKSIZ-byte block contains some number of  directory
     entry structures, which are of variable length.  Each direc-
     tory entry has a struct direct at the front of it,  contain-
     ing  its  inode  number,  the  length  of the entry, and the
     length of the name contained in the entry.  These  are  fol-
     lowed  by  the  name  padded  to a 4 byte boundary with null
     bytes.  All names are guaranteed null-terminated.  The  max-
     imum length of a name in a directory is MAXNAMLEN.

          #define DIRBLKSIZ   DEVBSIZE
          #define MAXNAMLEN   256
          struct    direct {
               ulong    dino;              /* inode number of entry */
               ushort   dreclen;      /* length of this record */
               ushort   dnamlen;      /* length of string in dname */
               char dname[MAXNAMLEN + 1];   /* name must be no longer than this */
          };

SEE ALSO
     ufs-specific fs(4)





















                                                                1



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