DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dir_ufs(4)


dir (ufs) -- format of ufs directories

Synopsis

   #include <sys/param.h>
   #include <sys/types.h>
   #include <sys/fs/ufs_fsdir.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 (for example, 512 bytes on most machines).

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

   #define DIRBLKSIZ    DEV_BSIZE
   #define MAXNAMLEN    256
   struct     direct {
       u_long    d_ino;	/* inode number of entry */
       ushort_t   d_reclen;	/* length of this record */
       ushort_t   d_namlen;	/* length of string in d_name */
       char      d_name[MAXNAMLEN + 1];	/* name must be no longer than this */
   };

References

fs_ufs(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004