DescriptionIn this assighment, you are asked to implement a simpleversion of 'tar’. We will implement two programs (onecalled packfiles and the other called unpackfiles). Thepackfiles program...

Down below


Description In this assighment, you are asked to implement a simple version of 'tar’. We will implement two programs (one called packfiles and the other called unpackfiles). The packfiles program will create an archive file (i.e., a file that contains other files) from a list of files. The unpackfiles program will extract the files from a given archive file. The usage of two programs are as follows: ./packfiles archive_file filel file2 ... ./unpackfiles archive_file The packfiles program takes at least two command-line arguments: archive_file and filel. The archive_file is the name of the archive file to be created and filel is the first file to be added to the archive. There can be more than one files to be added to the archive. The unpackfiles program takes only one argument: archive_file. The program will create separate files stored in the archive. Implementation The format of the archive file is as follows: e The packfiles program adds files to the archive. For each file to be added to the archive, we first annand a haadar nf 24 hvtac Tha firct fanir hvac Submit Assignment < previous="" next="" »="" ©="" bh="" bb="" nn="" 2x2="" dashboard="" calendar="" to="" do="" notifications="" inbox="" implementation="" the="" format="" of="" the="" archive="" file="" is="" as="" follows:="" e="" the="" packfiles="" program="" adds="" files="" to="" the="" archive.="" for="" each="" file="" to="" be="" added="" to="" the="" archive,="" we="" first="" append="" a="" header="" of="" 24="" bytes.="" the="" first="" four="" bytes="" contains="" the="" size="" of="" the="" file.="" and="" the="" next="" 20="" bytes="" contain="" the="" name="" of="" the="" file.="" you="" can="" assume="" the="" file="" name="" is="" no="" longer="" than="" 20="" bytes.="" (you="" may="" truncate="" the="" file="" name="" if="" necessary.)="" if="" the="" file="" name="" is="" less="" than="" 20="" bytes,="" the="" rest="" of="" the="" bytes="" are="" padded="" with="" lol="" r="" the="" archive="" then="" appends="" the="" content="" of="" the="" file="" immediately="" after="" the="" header.="" if="" the="" size="" of="" the="" add="" file="" is="" not="" a="" multiple="" of="" four="" bytes,="" we="" add="" padding="" so="" that="" we="" get="" a="" multiple="" of="" four="" bytes.="" all="" files="" are="" added="" to="" the="" archive="" sequentially="" in="" the="" same="" fashion="" one="" after="" another,="" each="" having="" 24="" bytes="" of="" header="" and="" having="" a="" multiple="" of="" four="" bytes="" for="" store="" its="" content.="" the="" unpackfiles="" program="" scans="" through="" the="" archive="" and="" creates="" each="" file="" in="" the="" same="" directory="" using="" the="" name="" of="" the="" file="" and="" the="" content="" stored="" in="" the="" archive.="" the="" following="" diagram="" shows="" arrangement="" of="" an="" archive="" with="" two="" added="" files,="" one="" called="" file="" 1="" with="" 21="" bytes="" in="" size="" and="" the="" other="" called="" otherfile="" with="" 206="" bytes="" in="" size.="" submit="" assignment="">< previous="" next="" »="" ©="" bh="" bb="" nn="" 2x2="" dashboard="" calendar="" to="" do="" notifications="" inbox="" so="" that="" we="" get="" a="" multiple="" of="" four="" bytes.="" e="" all="" files="" are="" added="" to="" the="" archive="" sequentially="" in="" the="" same="" fashion="" one="" after="" another,="" each="" having="" 24="" bytes="" of="" header="" and="" having="" a="" multiple="" of="" four="" bytes="" for="" store="" its="" content.="" e="" the="" unpackfiles="" program="" scans="" through="" the="" archive="" and="" creates="" each="" file="" in="" the="" same="" directory="" using="" the="" name="" of="" the="" file="" and="" the="" content="" stored="" in="" the="" archive.="" the="" following="" diagram="" shows="" arrangement="" of="" an="" archive="" with="" two="" added="" files,="" one="" called="" file="" 1="" with="" 21="" bytes="" in="" size="" and="" the="" other="" called="" otherfile="" with="" 206="" bytes="" in="" size.="" your="" code="" should="" be="" able="" to="" handle="" normal="" error="" conditions:="" a.="" the="" packfiles="" and="" unpackfiles="" programs="" should="" check="" the="" command-line="" arguments="" and="" prompt="" error="" if="" the="" user="" is="" not="" providing="" the="" argument(s)="" as="" expected.="" b.="" for="" packing,="" there="" must="" be="" at="" least="" one="" file="" presented="" to="" be="" added="" to="" the="" archive.="" c.="" the="" files="" to="" be="" archived="" must="" exist="" in="" the="" current="" directory="" (as="" regular="" files,="" not="" directories).="" and="" they="" should="" be="" readable.="" if="" not,="" the="" program="" should="" prompt="" error="" accordingly.="" submit="" assignment="">< previous="" next="" »="" ©="" bh="" bb="" nn="" 2x2="" dashboard="" calendar="" to="" do="" notifications="" inbox="" d.="" for="" unpacking,="" the="" archive="" must="" have="" correct="" format.="" the="" program="" should="" be="" able="" to="" scan="" through="" the="" archive="" to="" retrieve="" the="" files="" one="" at="" a="" time="" and="" create="" the="" file="" in="" the="" current="" directory="" with="" the="" stored="" content.="" submission="" please="" submit="" your="" work="" through="" canvas="" as="" a="" single="" gzipped="" tar="" file.="" follow="" the="" instructions="" below="" carefully="" (to="" avoid="" unnecessary="" loss="" of="" grade):="" e="" create="" adirectory="" for="" this="" homework="" and="" name="" it="" “hw4”.="" all="" your="" files="" for="" this="" assignment="" should="" be="" in="" this="" directory.="" e="" for="" submission,="" add="" a="" readme="" file="" (this="" is="" mandatory!).="" the="" readme="" file="" must="" contain="" the="" following="" content:="" i="" understand="" that="" all="" homework="" assignments="" f="" i="" testify="" that="" i="" have="" worked="" by="" myself="" on="" th="" [your="" name="" and="" date]="" i="" understand="" that="" i'm="" allowed="" to="" look="" for="" so="" [put="" none="" or="" list="" the="" sources="" in="" the="" followi="" 1)="" in="" main.c,="" lines="" 17-19,="" i="" used="" the="" soluti="" 2)="" in="" myfile.c,="" lines="" 6-8,="" i="" used="" the="" soluti="" submit="" assignment="">< previous next » © bh bb nn 2x2 dashboard calendar to do notifications inbox previous="" next="" »="" ©="" bh="" bb="" nn="" 2x2="" dashboard="" calendar="" to="" do="" notifications="">
Nov 14, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here