GetFileHoleMap

Returns a block allocation map for a file

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Advanced

Syntax

  #include <nwadv.h> 
   
  int GetFileHoleMap  (  
     int     handle,   
     LONG    startingPosition,   
     LONG    numberOfBlocks,   
     BYTE   *replyBitMapP,   
     LONG   *allocationUnitSizeP); 
  

Parameters

handle

(IN) Specifies the pertinent file handle.

startingPosition

(IN) Specifies the 0-based byte offset into the file.

numberOfBlocks

(IN) Specifies the number of file blocks required for a given file. This indirectly specifies the size in bytes of replyBitMapP. This can be computed by knowing the file size and the size of a block:

numberOfBlocks = (file-size) / (bytes-per-block) bytes-per-block = 8 x (sectors-per-block)

Use filelength and GetVolumeInformation to get the information to compute the number of blocks and round up, if necessary. The number specified must be in 4-byte increments: 4, 8, 12, etc.

replyBitMapP

(OUT) Points to a block of memory that should be considered as a bit-stream. If the bit is set, then the file block is allocated. If it is cleared, then the file block is not allocated.

allocationUnitSizeP

(OUT) Points to the size of each block in bytes.

Return Values

This function returns a value of 0 if successful. Otherwise, it returns an error code (nonzero value).

Remarks

The startingPosition and numberOfBlocks specify which part of the file to return information about.