Record format

The format of the records in each file list file can be expressed as shown in the following example.

Each file list file:
iAggregate:WEIGHT:INODE:GENERATION:SIZE:iRule:resourceID:attr_flags:
path-length!PATH_NAME:pool-length!POOL_NAME
[;show-length>!SHOW]end-of-record-character
where:
Note: You can only change the values of the iAggregate, WEIGHT, SIZE, and attr_flags fields. Changing the values of other fields can cause unpredictable policy execution results.

All of the numeric fields are represented as hexadecimal strings, except the path-length, pool-length, and show-length fields, which are decimal encoded. These fields can be preceded by a minus sign ( - ), which indicates that the string that follows it contains escape sequences. In this case, the string might contain occurrences of the character pair \n, which represents a single newline character with a hexadecimal value of 0xA in the filename. Also, the string might contain occurrences of the character pair \\, which represents a single \ character in the filename. A \ will only be represented by \\ if there are also newline characters in the filename. The value of the length field within the record counts any escape characters.

The encoding of WEIGHT is based on the 64-bit IEEE floating format, but its bits are flipped so that when a file list is sorted using a conventional collating sequence, the files appear in decreasing order, according to their WEIGHT.

The encoding of WEIGHT can be expressed and printed using C++ as:
double w =  - WEIGHT;
/* This code works correctly on big-endian and little-endian systems */ 
uint64 u = *(uint64*)&w;  /* u is a 64 bit long unsigned integer 
     containing the IEEE 64 bit encoding of the double floating point 
     value of variable w */
     uint64 hibit64 = ((uint64)1<<63); 
if (w < 0.0) u = ~u;  /* flip all bits */
else u = u | hibit64; /* force the high bit from 0 to 1,
      also handles both “negatively” and “positively” signed 0.0 */
printf(“%016llx”,u);  
The format of the majority of each record can be expressed in C++ as:
printf("%03x:%016llx:%016llx:%llx:%llx:%x:%x:%llx:%d!%s:%d!%s",
  iAggregate, u /*encoding of –1*WEIGHT from above*/, INODE, … );

Notice that the first three fields are fixed in length to facilitate the sorting of the records by the field values iAggregate, WEIGHT, and INODE.

The format of the optional SHOW string portion of the record can be expressed as:
if(SHOW && SHOW[0]) printf(“;%d!%s",strlen(SHOW),SHOW);

For more information, see the topic mmapplypolicy command in the IBM Spectrum Scale: Administration and Programming Reference.