Compressing and extracting archives
Right-click one or more items in the file browser and macSCP can pack them into an archive, or unpack an archive that is already there. It works in both panes: on your Mac, and on the server in the other pane. When you work on the server, the packing and unpacking happens on the server, so nothing has to be downloaded and uploaded again.
Compressing
Section titled “Compressing”Select the files and folders you want, right-click, and choose Compress. A submenu offers three formats:
| Format | Result | Good for |
|---|---|---|
| ZIP Archive | .zip | Several files and folders in one archive |
| Compressed Tarball | .tar.gz | Several files and folders; the choice for names a ZIP archive refuses (see below) |
| Compressed File | .gz | One single file, squeezed on its own |
macSCP picks the name of the new archive for you and puts it next to the originals:
- One selected item gives its whole name plus the extension, so compressing
notes.txtgivesnotes.txt.tar.gz. - Several selected items give
Archiveplus the extension. - If that name is already taken, macSCP uses the next free one (
Archive 2.zip,Archive 3.zip) instead of touching the existing file.
A few choices are refused with a message instead of being attempted: a compressed file holds exactly one file, so it cannot take a folder or a selection of several items, and a ZIP archive cannot carry a name that contains a line break. For such a name, use the compressed tarball. A compressed file whose target name already exists is also refused; rename or remove the existing one first.
Extracting
Section titled “Extracting”Right-click an archive and choose Extract…. macSCP recognises .zip, .tar, .tar.gz (and .tgz) and .gz files; the entry is not offered for anything else, and not for a folder that happens to have such a name.
A sheet asks where to put the contents:
- Into this folder unpacks next to the archive.
- Into a new folder unpacks into a folder you name. The sheet suggests a free name, taken from the archive’s name.
A compressed .gz file always unpacks into the current folder, because it holds a single file. If a file with the name the result would get already exists, for example notes.txt beside notes.txt.gz, the sheet says so before you can press Extract, and nothing is extracted.
The sheet also tells you how many entries the archive holds and how many names from it already exist in the destination.
A ZIP archive whose name contains *, ? or [ is refused. Those characters can stand for other characters in a file name, so acting on such a name could unpack a different archive that happens to match it: with b*.zip and bb.zip in the same folder, both would be unpacked. Rename the archive to leave those characters out, and extract it again.
Nothing is overwritten
Section titled “Nothing is overwritten”Extraction never replaces a file that is already there. If a name from the archive exists in the destination, the existing file stays as it is and the rest of the archive is still unpacked. A compressed .gz file holds only one file, so there is nothing else to unpack: if its result would replace an existing file, macSCP refuses it instead. The sheet shows the number of such names before you confirm, so you can pick a new folder instead.
Progress and cancelling
Section titled “Progress and cancelling”While an archive is being made or unpacked, the pane shows what is running (for example “Compressing notes.txt…”) with a Cancel button. Each pane runs one archive operation at a time; starting a second one while the first is running tells you to wait or cancel. Archive operations are separate from the transfer queue, so they do not wait behind file transfers.
When a server does not have the tool
Section titled “When a server does not have the tool”Packing and unpacking use the archive tools that are installed on the server. If a server does not have one, macSCP says which tool is missing instead of failing silently.
Some servers carry only a minimal set of tools, which has no way to leave an existing file alone. On such a server macSCP refuses to extract a .tar or .tar.gz archive instead of starting, because the run would stop partway and leave the rest of the archive unextracted. This is refused before you choose where to put the contents, so picking a new folder does not help. If you can, use a ZIP archive instead, or extract on the server itself. Compressing is not affected, and neither are ZIP archives and single compressed files.
Connections that cannot run commands on a server at all, such as S3 and WebDAV, do not show the Compress and Extract… entries in their file menu; the entries are still available in the pane that shows your Mac.
Other messages you may see:
| Message | What it means |
|---|---|
| The archive tool stopped with an error | The tool ran and reported a problem; the status number is in the message |
| The operation took too long and was stopped | It ran past its time limit |
| This archive holds too many entries to check against this folder first | The archive holds more entries than macSCP can check against the destination first, so it was not extracted |
| Another archive operation is still running in this pane | Wait for it to finish, or cancel it |
See also the two-pane browser and Transfers.