File Content Extraction 26.2
XML Export SDK C Programming Guide

# KVOpenFileArg

This structure defines the input arguments necessary to open a file for extraction. This structure is defined in `kvxtract.h`.

To open a file for extraction, initialize a `KVOpenFileArg` structure and pass it to the function fpOpenFile(). To specify the input document you should set one the members `stream`, `filePath`, or `document`, and set the other two to `NULL`.

    typedef struct  tag_KVOpenFileArg
    {
        KVStructHeader;
        KVCredential    cred;
        KVInputStream  *stream;
        char           *filePath;
        KVDocument      document;
        char           *extractDir;
        DWORD           openFlag;
        DWORD           reserved;
        void           *pReserved;
    }
    KVOpenFileArgRec, *KVOpenFileArg;

## Member Descriptions

`KVStructHeader` | The version of the structure. See KVStructHead.
`cred` | The credentials required to open a protected PST or NSF file. This is a pointer to the KVCredential structure. Your application can define multiple credentials to this member for multiple formats.
`stream` | A pointer to the developer-assigned instance of `KVInputStream`. The `KVInputStream` structure defines the input stream that contains the source. See KVInputStream.
`filePath` | A pointer to the full file path to the source file.
`document` | A `KVDocument` that represents the source file.
`extractDir` | A pointer to the default directory to which subfiles are extracted. This directory must exist. You can use this in conjunction with `KVExtractSubFileArg->filePath` to create the full output path. See KVExtractSubFileArg.
`openFlag` | A bitwise flag that defines additional parameters for opening the file. The following flag is available: `KVOpenFileFlag_CreateRootNode`—If you set this flag, File Content Extraction creates a root object when extracting this file’s subfiles. This root node does not have a parent and is at the highest level of the file’s tree structure. It is used internally to provide a reference point from which all other child nodes are determined, and the file’s hierarchy is created. If you want to maintain the file’s hierarchy when you extract subfiles from a container, you must set this flag. See Understand the Subfile Hierarchy for more information. The root node has an index of zero. Although not all container formats require an artificial root node, the root is created for all container formats regardless of whether the file itself contains a root directory or file.
`reserved` | Reserved for future use. It must be `NULL`.
`pReserved` | Reserved for future use. It must be `NULL`.

## Discussion

- On Windows, `filePath` and `extractDir` must be in the local Windows code page.

Copyright 1997-2026 Open Text
Version 26.2 | Last updated April 2026

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 26.2

Topic Title: KVOpenFileArg