FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kStorage_DownloadToBuffer ( kStorage  storage,
const kChar filePath,
void *  buffer,
kSize  capacity,
kCallbackFx  progress,
kPointer  context 
)

Reads the contents of a storage file into a memory buffer.

This function will fail if the capacity of the buffer does not match the size of the file.

If the remote node supports progress feedback, the specified callback will be invoked to provide updates on the progress of the operation. The callback 'args' parameter will receive a k32u value representing the percentage completed.

Parameters
storageStorage object.
filePathFile path.
bufferReceives data read from the file.
capacityBuffer capacity.
progressOptional progress callback (can be kNULL).
contextCallback context.
Returns
Operation status.