Tar
This section is dedicated to the library for working with tar archives in 1C:Enterprise, OneScript and CLI. This page describes all the actions necessary for a complete start of work
Getting Started
The library provides capabilities for working with tar format archives: creating archives, unpacking, extracting individual files, modifying existing archives and working with gzip compression.
Main Features
Archiving Directories
The АрхивироватьКаталог function allows you to pack files from the specified directory into a tar archive. You can specify a path to save the archive or get it as binary data.
Каталог = "C:\МойКаталог";
ПутьАрхива = "C:\Архивы\архив.tar";
Результат = OPI_Tar.АрхивироватьКаталог(Каталог, ПутьАрхива);
Unpacking Archives
The РазархивироватьКаталог function allows you to unpack a tar archive to a specified directory.
ПутьАрхива = "C:\Архивы\архив.tar";
КаталогНазначения = "C:\Распаковка";
Результат = OPI_Tar.РазархивироватьКаталог(ПутьАрхива, КаталогНазначения);
Unpacking Individual Files
The РазархивироватьФайлы function allows you to extract only selected files from the archive by a list of their paths inside the archive.
ПутьАрхива = "C:\Архивы\архив.tar";
Пути = Новый Массив;
Пути.Добавить("docs/readme.txt");
Пути.Добавить("config/settings.json");
КаталогНазначения = "C:\Распаковка";
Результат = OPI_Tar.РазархивироватьФайлы(ПутьАрхива, Пути, КаталогНазначения);
Modifying Archives
The ИзменитьАрхив function allows you to add new files, replace or delete existing files in a tar archive without complete repacking.