The
By convention, the name of a tar file should end in "
Tar files can be created in one operation using the
Alternatively, for more control, the
To extract all files from a tar file, use the
To return a list of the files in a tar file,
use either the
To convert an error term returned from one of the functions
above to a readable message, use the
If
If
The
An example of this is the sftp support in
For maximum compatibility, it is safe to archive files with names
up to 100 characters in length. Such tar files can generally be
extracted by any
If filenames exceed 100 characters in length, the resulting tar
file can only be correctly extracted by a POSIX-compatible
File have longer names than 256 bytes cannot be stored at all.
The filename of the file a symbolic link points is always limited to 100 characters.
The
By default, symbolic links will be stored as symbolic links
in the tar file. Use the
Print an informational message about the file being added.
Read data in parts from the file. This is intended for memory-limited
machines that for example builds a tar file on a remote machine over
The
The
The
The
The options in
The entire tar file will be compressed, as if it has
been run through the
By default, the
By default, symbolic links will be stored as symbolic links
in the tar file. Use the
Print an informational message about each file being added.
The
If the
If the
Otherwise,
The
If the
If the
Otherwise,
The following options modify the defaults for the extraction as follows.
Files with relative filenames will by default be extracted
to the current working directory.
Given the
By default, all files will be extracted from the tar file.
Given the
Given the
By default, the
Instead of extracting to a directory, the memory option will give the result as a list of tuples {Filename, Binary}, where Binary is a binary containing the extracted data of the file named Filename in the tar file.
By default, all existing files with the same name as file in
the tar file will be overwritten
Given the
Print an informational message as each file is being extracted.
The
The
By convention, the name of a tar file should end in "
Except for the
The entire tar file will be compressed, as if it has
been run through the
By default, the
Use the
The
The
The
The parameter
The fun clauses parameter lists are:
A complete
ExampleFun =
fun(write, {Fd,Data}) -> file:write(Fd, Data);
(position, {Fd,Pos}) -> file:position(Fd, Pos);
(read2, {Fd,Size}) -> file:read(Fd,Size);
(close, Fd) -> file:close(Fd)
end
where
{ok,Fd} = file:open(Name,...).
{ok,TarDesc} = erl_tar:init(Fd, [write], ExampleFun),
The
erl_tar:add(TarDesc, SomeValueIwantToAdd, FileNameInTarFile),
....,
erl_tar:close(TarDesc)
When the erl_tar core wants to e.g. write a piece of Data, it would call
The example above with
The
The
The
The
The