---
layout: doc
title: general / uncompress_file
---
# uncompress_file

### NAME

    uncompress_file() - expand a gzip file on disk

### SYNOPSIS

    int uncompress_file( string input_file, void | string output_file );

### DESCRIPTION

    Uncompresses the gzip file input_file and writes the result to
    output_file.  If output_file is omitted, input_file must end in ".gz",
    and the driver writes to the same path with the ".gz" suffix removed.

    On success, the original input_file is deleted and 1 is returned.  On
    failure, 0 is returned.  Failure cases include invalid arguments, invalid
    read or write permissions, an input file that cannot be opened, an output
    file that cannot be opened, or omitting output_file when input_file does
    not end in ".gz".

    The paths are checked through the driver's normal valid_read() and
    valid_write() mechanisms.

### SEE ALSO

    compress_file(3), compress(3), uncompress(3), valid_read(4),
    valid_write(4)
