getTotalFileLength64

getTotalFileLength64(selector: Integer): Integer64;

The getTotalFileLength64 method of the DbFile class returns the total bytes occupied by a database map file, including partitions and Unstructured Data Resource (UDR) files.

The value of the selector parameter is a bitmask that defines which subfile types to include in the bytes total. One or more of the first four of the following DbFile class constants values, separated by the plus symbol (+), can be added together to give a subtotal.

DbFile Class Constant Unpartitioned Map Partitioned Map
GetTotLen_Base (1) X.dat X.dat + X_ndx.dat
GetTotLen_Partitions (2) 0 Sum(X_partNNNNNNNNNN.dat)
GetTotLen_SharedFileUDRs (4) X_udr.dat Sum(X_partNNNNNNNNNN_udr.dat)
GetTotLen_SingleFileUDRs (8) Sum(X_udr[<oid>].dat) Sum(X_partNNNNNNNNNN_udr[<oid>].dat)
GetTotLen_Everything (255) Sum of all subfiles Sum of all subfiles

Except for the GetTotLen_Everything (255) value, in this table the integer values in parentheses after the first four class constant names are bit positions. The X value represents the map file name and the NNNNNNNNNN value represents a partition number.

The following code fragments are examples of the getTotalFileLength64 method.

write myDbFile.getTotalFileLength64(DbFile.GetTotLen_Base);
// 1 - simple case, just the .dat, or if partitioned, the
// .dat + the global index _ndx.dat
write myDbFile.getTotalFileLength64(DbFile.GetTotLen_Base + 
             DbFile.GetTotLen_SharedFileUDRs);
// 1 + 4 - add in the _udr file length if the file exists

The following code fragment is an example of the getTotalFileLength64 method when you have Integer options in your method.

options:= DbFile.GetTotLen_Base + DbFile.GetTotLen_SharedFileUDRs;
write dbFile.getTotalFileLength64(options);