File Content Extraction 25.4
Filter SDK C Programming Guide

# fpGetMainFileInfo()

This function determines whether a file is a container file—that is, whether it contains subfiles—and should be extracted further.

## Syntax

    int (pascal *fpGetMainFileInfo) (
        void               *pFile,
        KVMainFileInfo     *fileInfo);

## Arguments

`pFile` | The identifier of the file. This is a file handle returned from fpOpenFile() or fpOpenFileFromFilterSession().
`fileInfo` | On success, this KVMainFileInfo points to a newly allocated structure, which provides information about this container file.

## Returns

- If the file information is retrieved, the return value is `KVERR_Success`.

- If the file information is not retrieved, the return value is an error code.

## Lifetime and Memory Management

- After `fpGetMainFileInfo()` returns `KVERR_Success`, you must call fpFreeStruct() to free the memory allocated for `fileInfo`. You must free this memory before you call fpCloseFile().

## Discussion

- If the file is a container (`fileInfo->numSubFiles` is non-zero), you can call fpGetSubFileInfo() and fpExtractSubFile() for each subfile to get information about and extract each subfile.

## Example

    KVMainFileInfo   fileInfo    = NULL;
    if( (error=extractInterface->fpGetMainFileInfo(pFile,&fileInfo)))
    {
        /* Free result object allocated in fileInfo */
        extractInterface->fpFreeStruct(pFile,fileInfo);
        fileInfo = NULL;
    }

Copyright 1997-2025 Open Text
Version 25.4 | Last updated October 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 25.4

Topic Title: fpGetMainFileInfo()