File Content Extraction 26.1
Filter SDK C++ Programming Guide

# extract

Some files can contain embedded subfiles, including archive formats such as `zip` and `rar`, email containers, and Office formats. This sample program makes use of the subfile extraction API methods.

The sample program takes two positional arguments:

- a path to a file
- a path to an output directory

The program copies all the subfiles in the file to the output directory, and prints any errors encountered during extraction. For example, the following output is produced when you run the program on a password-protected 7zip file:

    $ ./extract pass.7z outputdir/
    Error extracting subfile 0
    Name: hello.txt
    Keyview error: The file is password protected

If you provide the correct password using the optional argument, File Content Extraction can extract the file:

    $ ./extract --password 'pass' pass.7z outputdir/
    $ ls outputdir/
    hello.txt

NOTE: In this instance File Content Extraction captures the name of the subfile even without providing a password. Whether this is possible depends on the file format and the encryption options that were used to create the file.

Copyright 1997-2025 Open Text
Version 26.1 | Last updated January 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.1

Topic Title: extract