yarikleto / Qwr

Shared solutions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Welcome to My Tar


Task

The task is to recreate a version of the Tar (Tape Archive) utility (my_tar). My_tar's functionalities are mirrored after the GNU tar program.

Description

The Tar utility is used for collecting files (archive members) into an archive file. The modes for my_tar are as follows:

  1. -c: creating a new archive

  2. -r: appending a new archive member to an existing archive or creating a new archive if the specified archive does not exist

  3. -u: update an existing archive member if its modification date is newer than that of its corresponding archive member.

  4. -t: list tar archive file's contents

  5. -x: Extract to disk from the archive file

Installation

The executable program is my_tar. The required files are in the Program Dependencies section.

Program Dependencies

alt text

Usage

-c Create an archive

  • ./my_tar -cf [tar_file]
  • ./my_tar -cf [tar_file] [item1, item2, ...]

-t List archive contents

  • ./my_tar -tf [tar_file]

-r Append archive members

  • ./my_tar -rf [non-existent file]
  • ./my_tar -rf [non-existent file] [non-existent file]
  • ./my_tar -rf [non-existent file] [non-existent file]
  • ./my_tar -rf [non-existent file] [existing file]
  • ./my_tar -rf [existing file] [existing file]
  • ./my_tar -rf [existing file]

-u Update archive

Usage is the same as -r mode with the additional functions:

  • ./my_tar -uf [existing tar file] [newer entry]
  • ./my_tar -uf [existing tar file] [newer entry] [same newer entry]

-x Extract archive

  • ./my_tar -tf [tar file]
  • ./mY-tar -tf [tar file] [tar_file file1, tar_file file2, ...]

Things to Improve

  1. Handle duplicate specified files

  2. Make specified directories to be extracted '/' agnostic

  3. List specified archive member

The Core Team

Ricky Liu

Yaroslav Pakhaliuk

About

Shared solutions


Languages

Language:C 87.6%Language:Shell 11.9%Language:Makefile 0.5%