isc-tarisc-tar
Watch
0
Star
1
Category
Frameworks
Works with
Tags
Version
0.1.2
Last updated
2019-03-23
Repository
License
Download
Discuss
Details
Version history
Issues
Discuss

What's new in this version

Compact files as TAR or Extract files from TAR files

TAR compress tool

Tar compress tool for InterSystems products

This tool helps to extract data right from tar.gz or just tar archives with ObjectScript. Or compact any files/folders with tar format and make tar.gz.

Installation

Import and compile file zUtils.FileBinaryTar.xml to %SYS namespace.

Examples

Extract tar.gz file

  Set gzip = 1
  Set extracted = ##class(%zUtils.FileBinaryTar).ExtractFile("/tmp/some.tgz", gzip)
  Set tSC = extracted.FindPath("folder/subfolder/test.txt", .file)
  Set fileContent = file.fileData
  While 'fileContent.AtEnd {
    /// read file from archive
  }
  Set tSC = extracted.ExtractTo("/tmp/some/place")

Compact folder/file to tar.gz file

  Set gzip = 1
  Set archive = ##class(%zUtils.FileBinaryTar).Compact("/tmp/some/place", gzip, "/tmp/some.tgz")