simple_expak utilityΒΆ

Installation of the expak module will also install a simple_expak utility in your path. This utility exists to essentially perform the same kinds of operations as supported by expak.extract_resources(), but with a model better suited for quick manual command-line use.

simple_expak accepts any number of command-line arguments. Any argument that ends in ”.pak” (case-insensitive) is treated as a pak file path; any other argument is treated as the name of a resource to extract from the pak file(s). Pak file paths and resource names can be freely intermingled.

If one or more pak files are specified, but no resources, then all resources are extracted from all of the specified pak files.

Example of extracting all resources from “pak0.pak” and “pak1.pak”:

simple_expak pak0.pak pak1.pak

Examples of extracting specific resources from pak files:

simple_expak pak1.pak sound/misc/basekey.wav

simple_expak pak0.pak pak1.pak maps/e1m1.bsp maps/e2m1.bsp maps/e3m1.bsp

Whenever a resource is extracted from a pak file, it will be created under a directory path relative to the current working directory, determined by the resource name as described for the expak.nop_converter() function.

If any user-specified resources are not found, or are unable to be extracted, then simple_expak will print a list of such resources once it is done.

An I/O error during reading a pak file or writing an extracted resource will not prevent simple_expak from continuing with other pak files or resources. Once simple_expak is done processing as many paks/resources as possible, it will exit with a status of 0 if no such exceptions were encountered, or 1 otherwise.


python -m expak behaves identically to simple_expak.