# The &ark; Handbook

## Introduction

&ark; is a program for viewing, extracting, creating and modifying archives. &ark; can handle various archive formats such as `tar`, `gzip`, `bzip2`, `zip`, `rar`, `7zip`, `xz`, `rpm`, `cab`, `deb`, `xar` and `AppImage` (support for certain archive formats depends on the appropriate command-line programs being installed).

&ark;'s main window

In order to successfully use &ark;, you need KDE Frameworks 5. The library libarchive version 3.1 or above is needed to handle most archive types, including tar, compressed tar, rpm, deb and cab archives. To handle other file formats, you need the appropriate command line programs, such as `zipinfo`, `zip`, `unzip`, `rar`, `unrar`, `7z`, `lsar`, `unar` and `lrzip`.

## Using &ark;

### Opening Archives

To open an archive in &ark;, choose Open... (&Ctrl;O) from the Archive menu. You can also open archive files by dragging and dropping from &dolphin;. Archive files should be associated with &ark;, so you can also right click a file in &dolphin; and select Open with &ark; to open it or select an extract action for this file.

If you have enabled the information panel in the Settings menu additional information about the selected folders or files in the archive is displayed.

#### Archive Operations

Various operations can be performed for an opened archive by using the Archive menu. For example, you can save the archive with a different name using Save As.... Archive properties such as type, size and MD5 hash can be viewed using the Properties item.

&ark; has the ability to test archives for integrity. This functionality is currently available for `zip`, `rar` and `7z` archives. The test action can be found in the Archive menu.

#### Archive Comments

&ark; can handle comments embedded in `zip` and `rar` archives.

Comments embedded in `zip` archives are automatically displayed.

Using `rar` archives you can modify a comment with the actions Add Comment or Edit comment (&Alt;C) from the Archive menu.

Editing a comment

The comment menu item is enabled only for `rar` archives.

To remove a comment from a `rar` archive delete the text in the comment window.

### Working with Files

Once an archive has been opened, you can perform various operations on the files inside the archive. By selecting a file and using the File menu, you can choose different operations to perform:

- Preview (&Ctrl;P) will open the file with &ark;'s internal viewer. This is a fast read-only viewer, but does not support all file types.

- Open will open the file in the associated application for that file type.

- Open With... allows you to choose which application to open the file with.

- Rename (&Alt;F2) This action allows to change names of both files and folders. As in the Dolphin file manager, this action can be called via a shortcut and renaming is done via inline editing. There are also filename checks provided, which prevent usage of invalid characters such as `/`, `.` and `..` in filenames.

- Delete (Del) will remove the currently selected file(s) from the archive. Note that this action is undoable.

- Extract (&Ctrl;E) opens a submenu with previously accessed folders, and you can choose to quickly extract into any of these or browse to a non-listed folder. See the next section for more details on extraction.

- Cut (&Ctrl;X) / Copy (&Ctrl;C) / Paste (&Ctrl;V): As in typical file managers, moving, pasting and copying are provided. Users can move or copy files from different folders (which are expandable in the tree view) and paste them to the same destination at once. A folder can be copied into itself, but can not be moved. There are also checks for conflicting filenames: You won't be able to copy or move files into a folder that has entries with the same names - that could lead to data loss.

- Add Files (&Alt;A) This action can be used to add files at any location within the archive. If you select a folder and use this action, files will be added to the selected folder. Otherwise, the new files will be added to the root of the archive.

#### Editing Files

If you edit and save a file which you opened using Open or Open With..., Ark will ask you if you want to update the file in the archive. If you answer Yes, the archive will be updated with the saved file.

### Extracting Files

Once an archive has been opened in &ark;, it can be extracted. This can be done by selecting Extract from the File menu. This opens a submenu with previously accessed folders, and you can choose to quickly extract into any of these. Alternatively, select the submenu item Extract To... to open the Extract dialog, where you can set various options that affect the extraction. See below for information on the available options in the Extract dialog.

You can also use the Extract button in the toolbar to access the same extraction options.

To extract the entire archive, you can select Extract All from the Archive menu. This action unconditionally extracts all files in the archive.

It is possible to extract files and folders by simply dragging them with the mouse to a folder in &dolphin;.

Note: Extracting files from an archive does not change the archive and its contents.

#### The Extract dialog

The Extract dialog allows you to choose where the files will be extracted to. The default location is the folder the archive is in. The dialog can also be opened by pressing &Ctrl;E.

&ark;'s Extract dialog

You can specify to extract the files into a subfolder. The default name of this subfolder is the archive name without the filename extension, but you can edit it to your needs. If you want to preserve paths when extracting, select the Preserve paths when extracting option. You may also choose to open the destination folder in &dolphin; or close &ark; once the extraction is complete.

If one or more files in the archive list are highlighted, you can also select which files to extract:

- Selected files only extracts only the files which have been selected.

- All files extracts the entire contents of the archive.

### Creating Archives and Adding Files

To create a new archive in &ark;, choose New (&Ctrl;N) from the Archive menu.

Create an archive

You can then type the name of the archive, with the appropriate extension (`tar.gz`, `zip`, `7z`, &etc;) or select a supported format in the Filter combo box and check the Automatically add `filename extension` option.

To add files or folders to the new archive, choose Add Files... from the Archive menu.

An alternative way to add files to an archive is to drag one or more files from e.g. &dolphin; into the main &ark; window, and it will be added to the current archive. Note that files added in this way will always be added to the root directory of the archive.

Additional options are presented in collapsible groups at the bottom of the dialog.

#### Compression

A higher value generates smaller archives, but results in longer compression and decompression times. The default compression level proposed by &ark; is usually a good compromise between size and (de)compression speed. For most formats the minimum compression level is equivalent to just storing the files, &ie; applying no compression.

For `rar`, `7z` and `zip` archives you can select between different compression methods.

Note that using compression methods other than the pre-selected defaults may limit compatibility with file archivers. For example, opening `zip` archives with compression methods other than Deflate requires newer archiving software.

#### Password Protection

If you create a `zip`, `rar`, `7zip` and `jar` archive you can protect it with a password. Currently, only the `zip` format supports multiple encryption methods. For other formats that support only one encryption method, the method is shown in the drop down box.

Other encryption methods than the default ZipCrypto might not be supported by all file archivers.

Create a password protected archive

Choose whether to require the password before showing the list of files. This is called header encryption and is available only with the `rar` and `7zip` formats. Header encryption is enabled by default (when available), in order to offer the maximum protection for novice users.

#### Multi-volume Archive

With the `zip`, `rar` and `7z` formats you can create multi-volume archives, also known as multi-part or split archives.

A multi-volume archive is one big compressed archive split into several files. This feature is useful if the maximum file size is limited, ⪚ by the capacity of a storage medium or the maximal size of an email with attachments.

To create a multi-volume archive, check the Create multi-volume archive checkbox and set a maximum Volume size in the dialog. Then add all files to the archive and &ark; will automatically generate the required number of archive volumes. Depending on the selected format the files have an extension with consecutively numbering scheme ⪚ `xxx.7z.001`, `xxx.7z.002` or `xxx.zip.001`, `xxx.zip.002` or `xxx.part1.rar`, `xxx.part2.rar` &etc;.

To extract a multi-volume archive, put all archive files into one folder and open the file with the lowest extension number in &ark; and all other parts of the split archive will be opened automatically.

## Using &ark; in the File Manager

Clicking with the &RMB; on an archive in a file manager like &dolphin; displays a context menu with an item Extract. The menu has these additional items to extract an archive using &ark;:

- Extract here creates a subfolder in the folder with the archive and extracts the folders and files into it. In case the archive contains only one file or folder, no subfolder will be created.

- Extract here and delete archive creates a subfolder in the folder with the archive, extracts the folders and files into it and deletes the archive.

- Extract to… opens the Extract dialog where you can choose the destination folder and various extraction options.

&dolphin;'s context menu for a selection of files and/or folders displays these actions in the Compress submenu:

- Compress to "Archive.tar.gz" and Compress to "Archive.zip" creates these archive types in the current folder.

- Compress to... opens a dialog where you can select folder, name and archive type.

## Advanced Batch Mode

&ark; has an advanced batch mode to manage archives without launching a graphical user interface. This mode allows you to extract or create archives and add files to them.

The batch mode is documented in &ark;'s man page.

## Credits and License

&ark; is Copyright © 1997-2016, The &ark; Development Team.

## Authors:

- Elvis Angelaccio elvis.angelaccio@kde.org

- Ragnar Thomsen rthomsen6@gmail.com

- Raphael Kubo da Costa rakuco@FreeBSD.org

- Harald Hvaal haraldhv@stud.ntnu.no

- Helio Chissini de Castro helio@conectiva.com.br

- Georg Robbers Georg.Robbers@urz.uni-hd.de

- Henrique Pinto henrique.pinto@kdemail.net

- Roberto Selbach Teixeira maragato@kde.org

- Robert Palmbos palm9744@kettering.edu

- Francois-Xavier Duranceau duranceau@kde.org

- Corel Corporation (author: Emily Ezust) emilye@corel.com

- Corel Corporation (author: Michael Jarrett) michaelj@corel.com

Documentation Copyright © 2000 &Matt.Johnston; &Matt.Johnston.mail;

Documentation updated for &kde; 3.3 by &Henrique.Pinto; &Henrique.Pinto.mail;.

Documentation updated for KDE Applications 16.04 by &Ragnar.Thomsen; &Ragnar.Thomsen.mail;.

&underFDL; &underGPL;
&documentation.index;