Skip to content
Andrew Lambert edited this page Nov 26, 2022 · 7 revisions

USTAR.TarWriter

Class Declaration

 Protected Class TarWriter

Remarks

This class is used to create tape archives.

Create a new instance, and then use the AppendDirectory and/or AppendEntry methods to build the archive. When ready, call the Commit method to generate the archive and write it to a file or memory stream.

Example

  Dim tar As New USTAR.TarWriter()
  
  ' Add a file to the archive root
  Call tar.AppendEntry(GetOpenFolderItem(""))
  
  ' recursively add contents of directory to archive root
  Dim dir As FolderItem = SelectFolder()
  tar.AppendDirectory(dir)
  
  ' recursively add a directory and its contents to archive root
  tar.AppendDirectory(dir, dir.Parent)
  
  ' delete a file
  tar.DeleteEntry("path/to/be/deleted.txt")
  
  ' delete a directory and its contents
  tar.DeleteEntry("path/to/be/deleted/")
  
  ' finish
  tar.Commit(SpecialFolder.Desktop.Child("test.tar"))

Methods

Properties

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally