Skip to main content

Archive directory

Pack files from the specified directory into a tar archive

Function ArchiveDirectory(Val Directory, Val ArchivePath = "", Val Settings = Undefined) Export

ParameterCLI optionTypeRequiredDescription
Directory--srcString, BinaryDataPath to the directory or data description for packing
ArchivePath--destStringPath to save the archive. To binary data if not filled
Settings--settingsMap Of KeyAndValueAdditional settings. See GetArchivingSettingsStructure
Returns

BinaryData, Map Of KeyAndValue - Execution information or binary archive data

tip

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
SourceDirectory = Parameters["Tar_SourceDir"];
ArchivePath = Parameters["Tar_ArchivePath"];

Result = OPI_Tar.ArchiveDirectory(SourceDirectory, ArchivePath);
# JSON data can also be passed as a path to a .json file

oint tar ArchiveDirectory \
--src "{'entries':[{'name':'readme.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/readme.txt'},{'name':'docs','directory':true,'entries':[{'name':'note.txt','directory':false,'from_path':true,'path':'/tmp//opi_tar_63920079983725/src/docs/note.txt'}]}]}"
Result
{
"result": true
}