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

CreateArchive

CreateArchive[source]
creates a compressed archive in the current directory from a file or directory specified by source.
CreateArchive
creates a compressed archive in the directory or file specified by path.
  • CreateArchive infers the compression format from the file extension of the archive name. If no extension is given, CreateArchive uses ZIP compression.
  • Possible file extensions include , , , , , , , , and .
  • CreateArchive[source] creates an archive file in the current working directory.
  • The source as well as the destination path can be a relative or absolute directory or file specification.
  • Relative directory or file paths are taken to be relative to the current working directory.
  • If a destination directory is given, CreateArchive automatically chooses a suitable file name for the archive.
  • CreateArchive returns the full file name of the archive it created, and $Failed if it cannot be created.
  • The file archive to be created must not already exist.
Create a ZIP archive from the ExampleData directory and place it into the current directory:
Create a .tar.gz archive in the current directory:
Specify an explicit destination path:
Fully specify a destination path and file name:
Create a ZIP archive from the ExampleData directory and place it into the current directory:
In[1]:=
Click for copyable input
Out[1]=
 
Create a .tar.gz archive in the current directory:
In[1]:=
Click for copyable input
Out[1]=
 
Specify an explicit destination path:
In[1]:=
Click for copyable input
Out[1]=
 
Fully specify a destination path and file name:
In[1]:=
Click for copyable input
Out[1]=
Prevent creation of intermediate directories to the destination path:
New in 8