-
-
Notifications
You must be signed in to change notification settings - Fork 4
USTAR.TarWriter
Andrew Lambert edited this page Oct 17, 2025
·
9 revisions
USTAR.TarWriter
Protected Class TarWriterThis 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.
Dim tar As New USTAR.TarWriter()
' Add a file to the archive root
Dim file As FolderItem = GetOpenFolderItem("")
Call tar.AppendEntry(file)
' 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
Dim output As FolderItem = SpecialFolder.Desktop.Child("test.tar")
tar.Commit(output)Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.