VxWorks API Reference : OS Libraries
tarLib - UNIX tar compatible library
tarExtract( ) - extract all files from a tar formatted tape
tarArchive( ) - archive named file/dir onto tape in tar format
tarToc( ) - display all contents of a tar formatted tape
This library implements functions for archiving, extracting and listing of UNIX-compatible "tar" file archives. It can be used to archive and extract entire file hierarchies to/from archive files on local or remote disks, or directly to/from magnetic tapes.
This Tar utility does not handle MS-DOS file attributes, when used in conjunction with the MS-DOS file system. The maximum subdirectory depth supported by this library is 16, while the total maximum path name that can be handled by tar is limited at 100 characters.
tarExtract( ) - extract all files from a tar formatted tape
STATUS tarExtract ( char * pTape, /* tape device name */ int bfactor, /* requested blocking factor */ BOOL verbose /* if TRUE print progress info */ )
This is a UNIX-tar compatible utility that extracts entire file hierarchies from tar-formatted archive. The files are extracted with their original names and modes. In some cases a file cannot be created on disk, for example if the name is too long for regular DOS file name conventions, in such cases entire files are skipped, and this program will continue with the next file. Directories are created in order to be able to create all files on tape.
The tape argument may be any tape device name or file name that contains a tar formatted archive. If tape is equal "-", standard input is used. If tape is NULL (or unspecified from Shell) the default archive file name stored in global variable TAPE is used.
The bfactor dictates the blocking factor the tape was written with. If 0, or unspecified from the shell, a default of 20 is used.
The verbose argument is a boolean, if set to 1, will cause informative messages to be printed to standard error whenever an action is taken, otherwise, only errors are reported.
All informative and error message are printed to standard error.
There is no way to selectively extract tar archives with this utility. It extracts entire archives.
tarArchive( ) - archive named file/dir onto tape in tar format
STATUS tarArchive ( char * pTape, /* tape device name */ int bfactor, /* requested blocking factor */ BOOL verbose, /* if TRUE print progress info */ char * pName /* file/dir name to archive */ )
This function creates a UNIX compatible tar formatted archives which contain entire file hierarchies from disk file systems. Files and directories are archived with mode and time information as returned by stat( ).
The tape argument can be any tape drive device name or a name of any file that will be created if necessary, and will contain the archive. If tape is set to "-", standard output will be used. If tape is NULL (unspecified from Shell), the default archive file name stored in global variable TAPE will be used.
Each write( ) of the archive file will be exactly bfactor*512 bytes long, hence on tapes in variable mode, this will be the physical block size on the tape. With Fixed Mode tapes this is only a performance matter. If bfactor is 0, or unspecified from Shell, it will be set to the default value of 20.
The verbose argument is a boolean, if set to 1, will cause informative messages to be printed to standard error whenever an action is taken, otherwise, only errors are reported.
The name argument is the path of the hierarchy to be archived. if NULL (or unspecified from the Shell), the current directory path "." will be used. This is the path as seen from the target, not from the Tornado host.
All informative and error message are printed to standard error.
Refrain from specifying absolute path names in path, such archives tend to be either difficult to extract or can cause unexpected damage to existing files if such exist under the same absolute name.
There is no way of specifying a number of hierarchies to dump.
tarToc( ) - display all contents of a tar formatted tape
STATUS tarToc ( char * tape, /* tape device name */ int bfactor /* requested blocking factor */ )
This is a UNIX-tar compatible utility that displays entire file hierarchies from tar-formatted media, e.g. tape.
The tape argument may be any tape device name or file name that contains a tar formatted archive. If tape is equal "-", standard input is used. If tape is NULL (or unspecified from Shell) the default archive file name stored in global variable TAPE is used.
The bfactor dictates the blocking factor the tape was written with. If 0, or unspecified from Shell, default of 20 is used.
Archive contents are displayed on standard output, while all informative and eror message are printed to standard error.