mn8 Language Reference | Index    

Tar

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

This concept allow to read and write the traditional UNIX tar file.
It currently supports creating, listing, removing and extracting from archives. It also supports GZIP - ed archives.

Usage

Create specified not compressed tar archive and extract all files from achive in specified directory

            $tar = Tar.create("tarName", false)
            $tar.extractAll("dirName")
        

Add files and string to tar archive.

            $tFile = Tar.create("TarName")
            $tFile.add("filePath")
            $tFile.add("text", "asPath")
       

Version: 0.1
Authors:Szabo Csaba
Inherits: Concept

Constructor List

create (String $path, Logical $compress)
top

Method List

add (String $path)
add (String $content, String $path)
Seriesdelete (String $path)
extract (String $dir, String $path)
extractAll (String $dir)
Serieslist
Stringview (String $path)
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML

Detailed Constructor Info

create (String $path, Logical $compress)
Parameters:
$path :

The path to the location where the file will be created with the archive name.

$compress :Determines if the tar file will be compressed or not.

Creates a new tar archive file with the specified path.

top

Detailed Method Info

add (String $path)
Parameters:
$path :The path to the file which will be added.
Exceptions:
openTarFailed :
(Error)
If unable to open tar archive.
addTarFailed :
(Error)
If could not add file to tar archive.
pathNotFound :
(Error)
If the specified directory or file not exists.

Adds the specified file to this archive.

top
add (String $content, String $path)
Parameters:
$content :The content of the file specified in the $path.
$path :The path to the file in the archive.
Exceptions:
openTarFailed :
(Error)
If unable to open tar archive.
addTarFailed :
(Error)
If could not add file to tar archive.

Adds a new file to this archive with the name specified in the $path and with the given $content.

top
delete (String $path)
Parameters:
$path :The path to the file in this archive which will be deleted.
Returns: Series
Exceptions:
removeFailed :
(Error)
If unable to remove entry form tar archive.
openTarFailed :
(Error)
If unable to open tar archive.

Deletes the specified file from this archive.

top
extract (String $dir, String $path)
Parameters:
$dir : The path to the directory in which will be extracted the specified file.
$path : The path to the file in this archive which will be extracted.
Exceptions:
fileExists :
(Warning)
If the file is already exists.
readFailed :
(Error)
If unable to read tar archive.

Extracts the specified file from this archive in the given directory.

top
extractAll (String $dir)
Parameters:
$dir : The path to the directory in which will be extracted this archive.
Exceptions:
fileExists :
(Warning)
If the file is already exists.
readFailed :
(Error)
If unable to read tar archive.

Extracts all files from this archive in the specified directory.

top
list
Returns: Series
Exceptions:
openTarFailed :
(Error)
If unable to open tar archive.

Returns a series which contains all files name in this archive.

top
view (String $path)
Parameters:
$path :The path in this archive to the file.
Returns: String
Exceptions:
pathNotFound :
(Warning)
If the entry not exists in tar archive.
readFailed :
(Error)
If unable to read tar archive.

Returns the file content specified by the $path.

top