*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> dir (4)              
Title
Content
Arch
Section
 

Contents


DIR(4)									DIR(4)


NAME    [Toc]    [Back]

     dir - format of EFS directories

SYNOPSIS    [Toc]    [Back]

     #include <sys/fs/efs_dir.h>

DESCRIPTION    [Toc]    [Back]

     A directory behaves exactly like an ordinary file,	save that no user may
     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	inode(4)].  The	EFS
     directory format supports variable	length names of	up to 255 characters.

DIRECTORY BLOCKS    [Toc]    [Back]

     Each EFS directory	is segmented into directory blocks defined by the
     following data structure:

	  #define EFS_DIRBLK_HEADERSIZE	4
	  struct  efs_dirblk {
		  /* begin header */
		  ushort      magic;
		  unchar      firstused;
		  unchar      slots;
		  /* end header	*/

		  /* rest is space for efs_dent's */
		  unchar      space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
	  };

     Each directory block is subdivided	into three separate areas: a header,
     an	array of entry offsets and an array of directory entries.  The system
     restricts directory entries to short boundaries and stores	offsets	in the
     directory block compacted by shifting them	right by one.

     The header	area contains a	magic number to	identify the block as being a
     directory block.  If the magic number is incorrect, the operating system
     will refuse to manipulate the directory, thus avoiding further
     corruption.

     The array of entry	offsets	immediately follows the	header and is sized
     according to the directories contents and contains	compacted offsets
     which point to each directory entry.  The number of entry offsets
     available is kept in slots.  The firstused	field contains a compacted
     offset which positions the	first byte of the directory entries.

     The space between the end of the entry array and the beginning of the
     directory entries (firstused) is free space which the system uses for
     allocating	new directory entries and entry	offsets.  The system keeps the
     free space	in a directory block compacted by coalescing holes created by
     entry removal.  When a directory entry is removed,	the system adjusts the
     entry offsets for all entries that	move.  Also, the entry offset for the
     removed entry is zeroed.  If the removed entry was	the last in the	entry
     offset array, the number of slots is reduced.  Directory entries never



									Page 1






DIR(4)									DIR(4)



     change which entry	offset they use.

DIRECTORY ENTRIES    [Toc]    [Back]

     Directory entries have the	following structure:

	  struct  efs_dent {
		  union	{
			ulong l;
			ushorts[2];
		  } ud_inum;
		  unchar      d_namelen;
		  char	d_name[3];
	  };

     The d_name	field is actually of variable size, depending upon the value
     contained in d_namelen.  The system pads out the directory	entry to
     insure that it begins on a	short boundary in the directory	block.	The
     ud_inum field contains the	entries	inode number.

SEE ALSO    [Toc]    [Back]

      
      
     fs(4), inode(4).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
dir Tru64 Format of directories
dir HP-UX format of directories on short-name HFS file systems
dxfileshare Tru64 Exports local directories and mounts directories from the network
bdftopcf Tru64 convert X font from Bitmap Distribution Format to Portable Compiled Format
DXmCvtCStoOS Tru64 Converts a compound string to an operatingsystem specific format. Currently uses text format.
acl_copy_int Tru64 Copies the ACL from contiguous, persistent format to internal working space format
bdftopcf HP-UX convert X font from Bitmap Distribution Format to Portable Compiled Format
bdftopcf IRIX convert X font from Bitmap Distribution Format to Portable Compiled Format
cddbcvt IRIX convert old (cdplayer) format CD database to new format
rmdir OpenBSD remove directories
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service