Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Tar Source Code
 previous   up   next 

Types
tarArchive
FileSys implementation type to access a TAR archive.

tarArchive

const type: tarArchive

FileSys implementation type to access a TAR archive. File paths in a tar archive can be absolute (they start with a slash) or relative (they do not start with a slash). The tar file system does support the concept of a current working directory. The functions chdir and getcwd are not supported by the tar file system. Absolute and relative paths in a tar archive can be accessed directly. Since "/" is just a normal path in a tar archive the root path of a tar file system is "". Possible usages of tar file system functions are:

 getMTime(aTarFile, "src/drivers")   # Relative path in the archive.
 fileType(aTarFile, "/usr/include")  # Absolute path in the archive.
 fileSize(aTarFile, "/image")        # Absolute path in the archive.
 readDir(aTarFile, "")               # Return e.g.: "src" and "/"
 readDir(aTarFile, "/")              # Return e.g.: "usr" and "image"

Function Summary
fileSys
openTar (inout file: tarFile)
Open a TAR archive with the given tarFile.
fileSys
openTar (in string: tarFileName)
Open a TAR archive with the given tarFileName.
void
close (inout tarArchive: tar)
Close a TAR archive.
array string
readDir (inout tarArchive: tar, in string: dirPath)
Determine the file names in a directory inside a TAR archive.
array string
readDir (inout tarArchive: tar, RECURSIVE)
Determine the file paths in a TAR archive.
fileType
fileType (inout tarArchive: tar, in var string: filePath)
Determine the type of a file in a TAR archive.
fileType
fileTypeSL (inout tarArchive: tar, in string: filePath)
Determine the type of a file in a TAR archive.
fileMode
fileMode (inout tarArchive: tar, in string: filePath)
Determine the file mode (permissions) of a file in a TAR archive.
void
setFileMode (inout tarArchive: tar, in string: filePath, in fileMode: mode)
Change the file mode (permissions) of a file in a TAR archive.
integer
fileSize (inout tarArchive: tar, in string: filePath)
Determine the size of a file in a TAR archive.
time
getMTime (inout tarArchive: tar, in string: filePath)
Determine the modification time of a file in a TAR archive.
void
setMTime (inout tarArchive: tar, in string: filePath, in time: modificationTime)
Set the modification time of a file in a TAR archive.
string
readlink (inout tarArchive: tar, in string: filePath)
Reads the destination of a symbolic link in a TAR archive.
string
getFile (inout tarArchive: tar, in string: filePath)
Get the contents of a file in a TAR archive.
void
putFile (inout tarArchive: tar, in string: filePath, in string: data)
Write data to a TAR archive with the given filePath.
void
mkdir (inout tarArchive: tar, in string: filePath)
Creates a new directory in a TAR archive.
void
for (inout string: filePath) range (inout tarArchive: tar) do (in proc: statements) end for
For-loop which loops recursively over the paths in a TAR archive.

Function Detail

openTar

const func fileSys: openTar (inout file: tarFile)

Open a TAR archive with the given tarFile.

Parameters:
tarFile - File that contains a TAR archive.
Returns:
a file system that accesses the TAR archive.

openTar

const func fileSys: openTar (in string: tarFileName)

Open a TAR archive with the given tarFileName.

Parameters:
tarFileName - Name of the TAR archive to be opened.
Returns:
a file system that accesses the TAR archive.

close

const proc: close (inout tarArchive: tar)

Close a TAR archive.


readDir

const func array string: readDir (inout tarArchive: tar, in string: dirPath)

Determine the file names in a directory inside a TAR archive. Note that the function returns only the file names. Additional information must be obtained with other calls.

Parameters:
tar - Open TAR archive.
dirPath - path of a directory in the TAR archive.
Returns:
an array with the file names.
Raises:
RANGE_ERROR - dirPath does not use the standard path representation.
FILE_ERROR - dirPath is not present in the TAR archive.

readDir

const func array string: readDir (inout tarArchive: tar, RECURSIVE)

Determine the file paths in a TAR archive. Note that the function returns only the file paths. Additional information must be obtained with other calls.

Parameters:
tar - Open TAR archive.
Returns:
an array with the file paths.

fileType

const func fileType: fileType (inout tarArchive: tar, in var string: filePath)

Determine the type of a file in a TAR archive. The function does follow symbolic links. When the chain of symbolic links is too long the function returns FILE_SYMLINK. When a symbolic link refers to a place where the permission is denied the function returns FILE_SYMLINK. A return value of FILE_ABSENT does not imply that a file with this name can be created, since missing directories and illegal file names cause also FILE_ABSENT.

Returns:
the type of the file.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.

fileTypeSL

const func fileType: fileTypeSL (inout tarArchive: tar, in string: filePath)

Determine the type of a file in a TAR archive. The function does not follow symbolic links. Therefore it may return FILE_SYMLINK. A return value of FILE_ABSENT does not imply that a file with this name can be created, since missing directories and illegal file names cause also FILE_ABSENT.

Returns:
the type of the file.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.

fileMode

const func fileMode: fileMode (inout tarArchive: tar, in string: filePath)

Determine the file mode (permissions) of a file in a TAR archive.

Returns:
the file mode.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive.

setFileMode

const proc: setFileMode (inout tarArchive: tar, in string: filePath, in fileMode: mode)

Change the file mode (permissions) of a file in a TAR archive.

Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive.

fileSize

const func integer: fileSize (inout tarArchive: tar, in string: filePath)

Determine the size of a file in a TAR archive. The file size is measured in bytes. For directories a size of 0 is returned.

Returns:
the size of the file.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive.

getMTime

const func time: getMTime (inout tarArchive: tar, in string: filePath)

Determine the modification time of a file in a TAR archive.

Returns:
the modification time of the file.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive.

setMTime

const proc: setMTime (inout tarArchive: tar, in string: filePath, in time: modificationTime)

Set the modification time of a file in a TAR archive.

Raises:
RANGE_ERROR - filePath does not use the standard path representation.
RANGE_ERROR - aTime is invalid or cannot be converted to the system file time.
FILE_ERROR - filePath is not present in the TAR archive.

readlink

const func string: readlink (inout tarArchive: tar, in string: filePath)

Reads the destination of a symbolic link in a TAR archive.

Returns:
The destination refered by the symbolic link.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive, or is not a symbolic link.

getFile

const func string: getFile (inout tarArchive: tar, in string: filePath)

Get the contents of a file in a TAR archive.

Returns:
the specified file as string.
Raises:
RANGE_ERROR - filePath does not use the standard path representation.
FILE_ERROR - filePath is not present in the TAR archive, or is not a regular file.

putFile

const proc: putFile (inout tarArchive: tar, in string: filePath, in string: data)

Write data to a TAR archive with the given filePath. If the file exists already, it is overwritten.

Raises:
RANGE_ERROR - filePath does not use the standard path representation.

mkdir

const proc: mkdir (inout tarArchive: tar, in string: filePath)

Creates a new directory in a TAR archive.

Raises:
RANGE_ERROR - dirPath does not use the standard path representation.
FILE_ERROR - A system function returns an error.

for

const proc: for (inout string: filePath) range (inout tarArchive: tar) do (in proc: statements) end for

For-loop which loops recursively over the paths in a TAR archive.



 previous   up   next