({{, (RefLink[ExtractArchive, paclet:ref/ExtractArchive])[file] 
expands an archive file, saving its content into the current directory.}, {, (RefLink[ExtractArchive, paclet:ref/ExtractArchive])[file,dir]
saves the content of an archive file into directory dir.}, {, (RefLink[ExtractArchive, paclet:ref/ExtractArchive])[file,dir,pattern]
extracts only files whose names match pattern.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ExtractArchive, paclet:ref/ExtractArchive]) supports a variety of file compression formats, including ZIP, GZIP, TAR, and BZIP2.

(RefLink[ExtractArchive, paclet:ref/ExtractArchive]) returns the names of the files and directories it created.

The archive to be extracted can be specified using a relative or absolute file specification.

The destination directory can be given as a relative or absolute directory path.

If any file in the archive to be extracted already exists, (RefLink[ExtractArchive, paclet:ref/ExtractArchive]) returns (RefLink[$Failed, paclet:ref/$Failed]) without creating any directories or files.

Directories extracted by (RefLink[ExtractArchive, paclet:ref/ExtractArchive]) may already exist.

(RefLink[ExtractArchive, paclet:ref/ExtractArchive])[file] does not delete file.

(RefLink[ExtractArchive, paclet:ref/ExtractArchive]) takes an option (RefLink[CreateIntermediateDirectories, paclet:ref/CreateIntermediateDirectories]) to specify whether intermediate directories should be created. The default setting is (RefLink[True, paclet:ref/True]).

(RefLink[ExtractArchive, paclet:ref/ExtractArchive])[(RefLink[File, paclet:ref/File])["file"],…] and (RefLink[ExtractArchive, paclet:ref/ExtractArchive])[file,(RefLink[File, paclet:ref/File])["dir"],…] are also supported.

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Uncompress a GZIP file, storing the result in the current directory:

ExtractArchive[$InstallationDirectory <> "/Documentation/English/System/ExampleData/747.3ds.gz"]

Specify the destination directory:

ExtractArchive[$InstallationDirectory <> "/Documentation/English/System/ExampleData/747.3ds.gz", $HomeDirectory]

OpenersExampleSection1(Spacer1)Scope  (1)

Create an archive from the ExampleData directory, then extract only JPEG files from it:

CreateArchive[$InstallationDirectory<>"/Documentation/English/System/ExampleData/"]

ExtractArchive[%,$HomeDirectory,"*.jpg"]

OpenersExampleSection2(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)CreateIntermediateDirectories  (1)

Prevent creation of intermediate directories to the destination path:

ExtractArchive[$InstallationDirectory<>"/Documentation/English/System/ExampleData/747.3ds.gz", 
$RootDirectory <> "non/existent/directory",CreateIntermediateDirectories->False]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CreateArchive, paclet:ref/CreateArchive])  ▪  (RefLink[Uncompress, paclet:ref/Uncompress])  ▪  (RefLink[Import, paclet:ref/Import])  ▪  (RefLink[Export, paclet:ref/Export])  ▪  (RefLink[FileSystemMap, paclet:ref/FileSystemMap])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Importing and Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}, {▪(RefLinkPlain[Compression and Archive Formats, paclet:guide/CompressionAndArchiveFormats])}})}})