ExtractArchive

ExtractArchive[source]

expands an archive file, saving its content into the current directory.

ExtractArchive[source,dir]

saves the content of an archive file into directory dir.

ExtractArchive[source,dir,pattern]

extracts only files whose names match pattern.

Details and Options

Examples

open allclose all

Basic Examples  (2)

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

Delete the resulting files:

Specify the destination directory:

Delete the resulting files:

Scope  (2)

Create an archive from the ExampleData directory:

Extract only JPEG files from the resulting archive:

Delete the resulting files and archive:

Extract an archive from a URL:

Delete the resulting files:

Options  (4)

CreateIntermediateDirectories  (2)

By default, intermediate directories are automatically created:

Delete the created directory:

Prevent creation of intermediate directories to the destination path:

IgnoreCase  (1)

Create an archive from the ExampleData directory:

By default, ExtractArchive uses case sensitive patterns:

Use IgnoreCase -> True to treat lowercase and uppercase letters as equivalents:

Delete the resulting files and archive:

OverwriteTarget  (1)

Create a ZIP archive:

Extract only the JPEG files from the archive:

Delete the first two extracted files:

By default, ExtractArchive will not extract any contents if any destination files already exist:

Use OverwriteTarget->Automatic to only extract files that do not already exist:

Use OverwriteTarget->True to overwrite any existing files:

Properties & Relations  (1)

CreateArchive creates a zip archive on the file system:

ExtractArchive creates new files with the extracted contents, without reading the file into memory:

Import can be used to import a specific file from an archive directly into Wolfram Language:

Wolfram Research (2010), ExtractArchive, Wolfram Language function, https://reference.wolfram.com/language/ref/ExtractArchive.html (updated 2020).

Text

Wolfram Research (2010), ExtractArchive, Wolfram Language function, https://reference.wolfram.com/language/ref/ExtractArchive.html (updated 2020).

BibTeX

@misc{reference.wolfram_2021_extractarchive, author="Wolfram Research", title="{ExtractArchive}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ExtractArchive.html}", note=[Accessed: 18-October-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_extractarchive, organization={Wolfram Research}, title={ExtractArchive}, year={2020}, url={https://reference.wolfram.com/language/ref/ExtractArchive.html}, note=[Accessed: 18-October-2021 ]}

CMS

Wolfram Language. 2010. "ExtractArchive." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ExtractArchive.html.

APA

Wolfram Language. (2010). ExtractArchive. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExtractArchive.html