Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q2 Directory Space Usage.attaching the PDF 2 Directory Space Usage [35 Marks] In this question, you have to write a program (myDU. c) that finds

Q2 Directory Space Usage.attaching the PDF

imageimageimageimage

2 Directory Space Usage [35 Marks] In this question, you have to write a program (myDU. c) that finds the space used by a directory (including its files, sub-directories, files in sub-directories, sub-sub directories etc.). Let's call this directory as the Root directory. Syntax $./myDU Example Documents (4096 bytes) Bill Payment.pdf (2324 bytes) Experiment_Results.txt Office (4096 bytes) (178 bytes) Deals.ppt (9590 bytes) $./myDU Documents 20284 Note: 4096 + 2324 + 178 + 4096 +9590 = 20284 bytes Figure 1: Example to illustrate the use of directory space usage finding utility Figure 1 shows the structure of a directory called Documents which is the designated Root directory in this example. This directory contains files such as Bill Payment.pdf, Experiment Results.txt and a sub-directory called Office. The Sub-directory Office contains a file named Deals.ppt. To find the size of the Documents directory, its name is passed to your directory space usage finding utility as ($./myDU Documents). Your utility is expected to print the total size of the contents of the passed root directory in bytes (For eg: 20284). Note that, this is inclusive of directory sizes.

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

Statistics For Managers Using Microsoft Excel

Authors: David M. Levine, David F. Stephan, Kathryn A. Szabat

7th Edition

978-0133061819, 133061817, 978-0133130805

More Books

Students also viewed these Algorithms questions