> Only one byte per directory entry?  This confuses
> programs that assume that the st_size reported for a
> directory is a multiple of sizeof(struct dirent)  bytes.

Sorry, but a program making this assumption is just flawed and should be fixed.

The POSIX standard is crystal-clear here and explicitely mentions:

http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html

off_t     st_size    For regular files, the file size in bytes. 
                     For symbolic links, the length in bytes of the 
                     pathname contained in the symbolic link. 
[SHM]
                     For a shared memory object, the length in bytes. 

[TYM]
                     For a typed memory object, the length in bytes. 

                     For other file types, the use of this field is 
                     unspecified. 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

a directory is strictly speaking not a regular file and this is in a way 
enforced by ZFS,
the standards wording further defines later on:

File type:

S_IFREG Regular.
S_IFDIR Directory.

hth
frankB
 
 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to