fpExtractSubFile()

This function extracts a subfile from a container file to a user-defined path or output stream. This call returns file format information when file is extracted to a path.

Syntax

int (pascal *fpExtractSubFile)  (
	            void                          *pFile, 
		    KVExtractSubFileArg            extractArg,
		    KVSubFileExtractInfo          *extractInfo);

Arguments

pFile The identifier of the file. This is a file handle returned from fpOpenFile().
extractArg

A pointer to the structure KVExtractSubFileArg, which defines the subfile to be extracted.

Before you initialize the KVExtractSubFileArg structure, use the macro KVStructInit to initialize the KVStructHead structure.

extractInfo A pointer to the structure KVSubFileExtractInfo, which defines information about the extracted subfile.

Returns

Discussion

Example

KVSubFileExtractInfo   extractInfo = NULL;

KVStructInit(&extractArg);

extractArg.index = index;
extractArg.extractionFlag = KVExtractionFlag_CreateDir | KVExtractionFlag_Overwrite;
extractArg.filePath = subFileInfo->subFileName;

/*Extract this subfile*/
error=extractInterface->fpExtractSubFile(pFile,&extractArg,&extractInfo);
if ( error )
{
   extractInterface->fpFreeStruct(pFile,extractInfo);
   subFileInfo = NULL;
}

_HP_HTML5_bannerTitle.htm