This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

ExtractArchive

ExtractArchive[file]
expands an archive file, saving its content into the current directory.
ExtractArchive
saves the content of an archive file into directory dir.
ExtractArchive
extracts only files whose names match pattern.
  • ExtractArchive supports a variety of file compression formats, including ZIP, GZIP, TAR, and BZIP2.
  • 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, ExtractArchive returns $Failed without creating any directories or files.
Uncompress a GZIP file, storing the result in the current directory:
Specify the destination directory:
Uncompress a GZIP file, storing the result in the current directory:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the destination directory:
In[1]:=
Click for copyable input
Out[1]=
Create an archive from the ExampleData directory, then extract only JPEG files from it:
Prevent creation of intermediate directories to the destination path:
New in 8