my_tar
======
The goal of this project is to implement the command **tar** in C++
only using
the standard library.
You can create as many files as you want and you can structure the
way you like.
## repository
Your repository will be called **final_project** and should be
hosted on my
server.
## tool chain
* make
* g++
## build
Your program will have to be built with **make**, but if no files
are changed,
then you need to display:
```
up-to-date
```
## binary
Your **Makefile** will have to generate a binary called **my_tar**.
## requirements
Your program will have to implement the following flags
```
-A, --catenate, --concatenate
Append archive to the end of another archive. The arguments
are treated
as the names of archives to append. All archives must be of the
same format
as the archive they are appended to, otherwise the resulting
archive might
be unusable with non-GNU implementations of tar. Notice also
that when
more than one archive is given, the members from archives other
than the
first one will be accessible in the resulting archive only if
using the -i
(--ignore-zeros) option.
Compressed archives cannot be concatenated.
-c, --create
Create a new archive. Arguments supply the names of the files to
be
archived. Directories are archived recursively, unless the --no-
recursion
option is given.
-d, --diff, --compare
Find differences between archive and file system. The arguments
are
optional and specify archive members to compare. If not given,
the current
working directory is assumed.
--delete
Delete from the archive. The arguments supply names of the
archive members
to be removed. At least one argument must be given.
This option does not operate on compressed archives. There is no
short
option equivalent.
-r, --append
Append files to the end of an archive. Arguments have the same
meaning as
for -c (--create).
-t, --list
List the contents of an archive. Arguments are optional. When
given, they
specify the names of the members to list.
--test-label
Test the archive volume label and exit. When used without
arguments, it
prints the volume label (if any) and exits with status 0. When
one or more
command line arguments are given. tar compares the volume label
with each
argument. It exits with code 0 if a match is found, and with
code 1
otherwise. No output is displayed, unless used together with the
-v
(--verbose) option.
There is no short option equivalent for this option.
-u, --update
Append files which are newer than the corresponding copy in the
archive.
Arguments have the same meaning as with -c and -r options.
-x, --extract, --get
Extract files from an archive. Arguments are optional. When
given, they
specify names of the archive members to be extracted.
--show-defaults
Show built-in defaults for various tar options and exit. No
arguments are
allowed.
-?, --help
Display a short option summary and exit. No arguments allowed.
--usage
Display a list of available options and exit. No arguments
allowed.
--version
Print program version and copyright information and exit.
-j, --bzip2
Filter the archive through bzip2(1).
-z, --gzip, --gunzip, --ungzip
Filter the archive through gzip(1).
```
## example
```
tar -cvf a.tar /etc
or
tar -c -v -f a.tar /etc
```
## implementation
* Your program will have to be able to extract tarballs generated by
the
command **tar**
* Your program should be able to create tarballs that can be opened
by **tar**