Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a program capable of archiving the contents of a directory into a single file, much like tar does. You will write a makefile that

create a program capable of archiving the contents of a directory into a single file, much like tar does. You will write a makefile that compiles your program into an executable named arch, which has usage

arch

action

-c to create a new archive file

-e to expand an existing archive file

source

Specifies the path-name of a directory that contains the files to be archived (-c) or of the archive file (-e) being expanded.

target

Specifies the path-name of the archive file that is to be created (-e) or of the directory to be created to hold the contents of the archive file.

Based on the command line arguments does one of the following:

Create: Create a new archive file (target) that, for each file in the directory specified by source, contains the data required to restore the file's name and data. The source directory is unchanged.

Expand: Create a new directory (target), which will contain all of the files and directories in the archive file, in their directory structure

Recurse the entire sub-tree rooted by (source) on create or expand

Proper care (error reporting / program termination) when opening and creating files and directories is required.

Sample Runs:

% ./arch -c . my_archive
archiving . 
Done  my_archive as been created

% ./arch -e ./expand_test my_archive
expanding to ./expand_test 
Done  my_archive as been expanded

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

ISBN: 3642271561, 978-3642271564

More Books

Students also viewed these Databases questions