tar(3tcl) 0.4 tar "Tar file handling"

NAME

tar - Tar file creation, extraction & manipulation

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    BUGS, IDEAS, FEEDBACK
    KEYWORDS

SYNOPSIS

package require Tcl 8.4
package require tar ?0.4?

::tar::contents tarball
::tar::stat tarball ?file?
::tar::untar tarball args
::tar::get tarball fileName
::tar::create tarball files args
::tar::add tarball files args
::tar::remove tarball files

DESCRIPTION

::tar::contents tarball
Returns a list of the files contained in tarball.



::tar::stat tarball ?file?
Returns a nested dict containing information on the named ?file? in tarball, or all files. the top level are pairs of filename and info. The info is a dict in the form mode uid gid size mtime type linkname uname gname devmajor devminor

 
% ::tar::stat tarball.tar
foo.jpg {mode 0644 uid 1000 gid 0 size 7580 mtime 811903867 type file linkname {} uname user gname wheel devmajor 0 devminor 0}



::tar::untar tarball args
Extracts tarball. -file and -glob limit the extraction to files which exactly match or pattern match the given argument. No error is thrown if no files match. Returns a list of filenames extracted and the file size. The size will be null for non regular files.

-dir dirName
-file fileName
-glob pattern
-nooverwrite
-nomtime
-noperms


 
% foreach {file size} [::tar::untar tarball.tar -glob *.jpg] {
puts "Extracted $file ($size bytes)"
}



::tar::get tarball fileName
Returns the contents of fileName from the tarball



::tar::create tarball files args
Creates a new tar file containing the files. files must be specified as a single argument which is a proper list of filenames.

-dereference


::tar::add tarball files args
Appends files to the end of the existing tarball. files must be specified as a single argument which is a proper list of filenames.

-dereference


::tar::remove tarball files
Removes files from the tarball

BUGS, IDEAS, FEEDBACK

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category tar of the Tcllib SF Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

KEYWORDS

archive, tape archive, tar