zInfoB_s

Contains detailed information about a file object and allows directory quota information to be returned.

Service:File System Services (64-Bit)
Defined In:zPublics.h

Syntax

#ifndef zGET_INFO_VARIABLE_DATA_SIZE
#define zGET_INFO_VARIABLE_DATA_SIZE (zMAX_COMPONENT_NAME*2)
#endif

typedef struct zInfo_s
{
   LONG    infoVersion;
   SLONG   totalBytes;
   SLONG   nextByte;
   LONG    padding;
   QUAD    retMask;
   struct  {           /* zGET_STD_INFO */
   } std;
   struct {            /* zGET_STORAGE_USED */
   } storageUsed;
   LONG   primaryNameSpaceID;   /* zGET_PRIMARY_NAMESPACE */
                                   /* zMOD_PRIMARY_NAMESPACE */
   LONG    nameStart;       /* zGET_NAME - index into zInfo */
   struct {            /* zGET_ALL_NAMES */
   } names;
   struct {
   } time;
   struct {           /* zGET_IDS */
   } id;
   struct {           /* zGET_BLOCK_SIZE */
   } blockSize;
   struct {           /* zGET_COUNTS */
   } count;
   struct {                     /* zGET_DATA_STREAM_INFO */
   } dataStream;
   struct {                  /* zGET_EXTENDED_ATTRIBUTE_INFO */
  } extAttr;
   struct {       /* zGET_DELETED_INFO, zMOD_DELETED_INFO & zMOD_DELETED_ID*/
   } deleted;
   struct
   {
      struct zMacInfo_s           /* zGET_MAC_METADATA */
   } macNS;
   struct                      /* zGET_UNIX_METADATA */
   {                           /* zMOD_UNIX_METADATA */
      struct   zUnixInfo_s
      LONG     offsetToData;
   } unixNS;
   zVolumeInfo_s   vol;      /* zGET_VOLUME_INFO */
   zPoolInfo_s     pool;     /* zGET_POOL_INFO */
   LONG   extAttrUserFlags;      /* zGET_EXTATTR_FLAGS */
                                 /* zMOD_EXTATTR_FLAGS */
   struct
   {
      SQUAD   quota;
      SQUAD   usedAmount;
   } dirQuota;
   BYTE   variableData [zGET_INFO_VARIABLE_DATA_SIZE];
} zInfo_s;

Fields

infoVersion

Specifies the version of the structure. Because this structure will need to change in the future, the version field identifies the particular structure being used.

totalBytes

Specifies the total number of bytes in fixed and variable data sections. Both sections are used so that the fixed area can grow without breaking older code pieces.

nextByte

Specifies the next byte to use in the variable area.

padding

Specifies some empty space.

retMask

Returns a bit mask of the fields actually returned by zGetInfo or zWildRead. Ignored by zModifyInfo.

std

Specifies the standard set of information. This field is selectable. With zWildRead, only the name of the file can be returned.

storageUsed

Returns three fields, if zGET_STORAGE_USED is set.

primaryNameSpaceID

Specifies the namespace used when the file was created. Names in the other namespaces are derived from the version of the filename in the primary namespace. On zModifyInfo, if zMOD_PRIMARY_NAMESPACE is set, the primary namespace is changed to the new value.

nameStart

Specifies an index with zGetInfo if zGET_NAME is set.

names

Returns two fields with zGetInfo if zGET_ALL_NAMES is set. Ignored by zModifyInfo.

time

Returns five fields: created, archived, modified, accessed, and metaDataModified with zGetInfo if zGET_TIMES is set. These are the UTC times when the file object was first created, last archived, last modified, last accessed, and the last time the metadata was modified. On zModifyInfo, each of the five fields can be modified separately, with a modify bit for each field.

id

Returns four fields: owner, archiver, modifier, and metaDataModifier with zGetInfo if zGET_IDS is specified. These are the NDS object IDs of the file object’s current owner, last archiver, last modifier, and last metadata modifier. With zModifyInfo, each of the four fields can be modified separately, with a modify bit for each field.

blockSize

Returns size and sizeShift with zGetInfo if zGET_BLOCK_SIZE is set. Ignored by zModifyInfo.

count

Returns open and hardLink with zGetInfo if zGET_COUNTS is set. Ignored by zModifyInfo.

dataStream

Returns three fields with zGetInfo if zGET_DATA_STREAM_INFO is set.

extAttr

Returns three fields with zGetInfo if zGET_EXTENDED_ATTRIBUTE_INFO is set. Ignored by zModifyInfo.

deleted

Returns the time and ID with zGetInfo if zGET_DELETED_INFO is set. On zModifyInfo, if zMOD_DELETED_INFO is specified, and if the file is a deleted file, the deleted info is modified.

macNS

Returns four fields: finderInfo, proDOSInfo, filler, and dirRightsMask with zGetInfo if zGET_MAC_METADATA is set. The filler field is filled in with zeroes because its only purpose is to LONG-align the rest of the structure. If the zNSPACE_MAC namespace is not enabled on the volume, this structure is filled in with zeros. On zModifyInfo, if zMOD_MAC_METADATA is specified, all fields (except filler) are modified in the metadata. If the zNSPACE_MAC namespace is not enabled on the volume, this structure is ignored.

unixNS

Returns the following fields: fMode, rDev, myFlags, nfsUID, nfsGID, nwUID, nwGID, nwEveryone, nwUIDRights, nwGIDRights, nwEveryoneRights, acsFlags, firstCreated, and variableSize with zGetInfo if zGET_UNIX_METADATA is set. If the zNSPACE_UNIX namespace is not enabled on the volume, this structure is filled in with zeroes. If variableSize is nonzero, variableStart indexes additional variable-sized UNIX metadata that is stored in the variableData section of this structure.

On zModifyInfo, if zMOD_UNIX_METADATA is specified, all fields are modified in the metadata, including the variableStart (if variableSize is nonzero and the variableStart index is nonzero). If the zNSPACE_UNIX namespace is not enabled on the volume, this structure is ignored.

vol

Specifies the information that is returned is for the volume where the file object resides. However, if the file object is a volume object in the admin volume, the volume information for the volume object is returned. If zGET_VOLUME_INFO is set, the following data can be returned:

  • If zMOD_VOL_MIN_KEEP_SECONDS is set in modifyInfoMask, minKeepSeconds is modified.

  • If zMOD_VOL_MAX_KEEP_SECONDS is set, maxKeepSeconds is modified.

  • If zMOD_VOL_LOW_WATER_MARK is set, lowWaterMark is modified.

  • If zMOD_VOL_HIGH_WATER_MARK is set, highWaterMark is modified.

extAttrUserFlags

Specifies an arbitrary value that is set by the user. This field only applies to extend attributes and has no particular significance to the file system.

dirQuota

Specifies quota information for a directory. Returns two fields: quota and usedAmount. The quota field contains the directory quota. The usedAmount field contains the amount of storage used within the directory.

variableData

Specifies additional data space, which is allocated by the caller, to be used for all returned variable length optional data for zGetInfo. It is the responsibility of the caller to make sure this variable section is large enough to hold all of the requested variable data. If it is not large enough, an error is returned and only the data that fits in this area is filled in. The caller references this area from indexes set in the fixed area. The indexes are relative to the front of the zInfo structure, not from the beginning of the of the beginning of the variable data area.

Remarks

All fields that are modifiable using zModifyInfo are marked with a /* zMOD_xxx */ comment tag, and all of the optional fields that can be retrieved using zGetInfo are marked with a /* zGET_xxx */ comment tag. When an entire substructure is modifiable or retrievable using a single bit, the comment tag is on the structure itself.

In order for it to be expanded in the future, this structure is identified by a version number as defined by zINFO_VERSION_A.

zInfo_s must be preallocated by the caller. It contains a fixed portion for fixed size data and a variable portion to contain variable size data indexed to by the fixed portion.

Data values fall on their natural boundaries without introducing fields for padding, which usually means the largest data items come first in the structure. Because this structure can be passed between 32-bit and 64-bit environments, all fields must be of the specified sizes and aligned correctly.

Variable length data items are added to the end with indexes to the corresponding offsets stored in the body of the structure. An index value of zero indicates there is no variable data for the item.

zGetInfo and zWildRead

The following rules apply to this structure when zGetInfo and zWildRead are called:

  • The fixed portion of this structure is filled based on the bits set in the getInfoMask parameter.

  • The variable portion must be large enough to store any variable size optional information requested. Data is not directly referenced in the variable portion; instead, it is referenced using indexes that are stored in the fixed portion. To make it easier to grow the fixed portion of the zInfo structure, the indexes start from the beginning of the data structure rather than from the variable data array.

    For example, if zGET_NAME was specified, the name information is stored in the variable portion, and the name index indexes the location in the variable section where the name was stored. This methodology allows the NSS system to pack variable size data into the variable data and still gives you easy access to all of the data through indexes.

  • When you are declaring stack variables and using the sizeof operator, the default size of the variable portion is equal to the value of the define zGET_INFO_VARIABLE_DATA_SIZE (zMAX_COMPONENT_NAME*2 bytes). If this size is inappropriate, it can be overridden by defining it before including zPublics.h as follows:

    #undef  zGET_INFO_VARIABLE_DATA_SIZE   
    #define zGET_INFO_VARIABLE_DATA_SIZE desired size
    
  • If the variable section is not large enough to contain all of the requested data, an error is returned that indicates some but not all of the requested data was returned. If this happens, portions of the variable data for which indexes were filled in can be considered valid, and the indexes to data that was not returned are set to zero.

zModifyInfo

The following rules apply to this structure when zModifyInfo is called:

  • The structure format is the same as that on zGetInfo, but zModifyInfo modifies only the fields identified by the bits set in the modifyInfoMask parameter. All other structure data that is not specified in the modifyInfoMask is ignored.

  • The variable portion is ignored.