Question: Expectations Students will: Design the data structure and algorithms required to solve the problem of the application. Investigate: o o o Test their solutions on

Expectations
Students will:
Design the data structure and algorithms required to solve the problem of the application.
Investigate:
o
o
o
Test their solutions on a variety of folders.
Presentation/Examples
1. Type fileusage
Prints the current directory and a recursively lists all files in the directory. So all files in the current directory and subfolders. The first column is the file type, the second column is the number of files of that type and the sum size of file for that type.
2. fileusage -h
h option is the help option. This prints out how to use the fileusage utility
3. Type fileusage c:\usr
Prints a list of files from a given path
4. Type fileusage -c ../../../..
Goes back 4 folders to list all the .c and .h files
5. Type fileusage -c+../../../..
Goes back 4 folders to list all the .c,.h,.cpp and .hpp files
6. Only the cpp and hpp files
7. fileusage -+cr ../..
the -r option suppresses recursion and displays the current files in the folder
8. fileusage -x \.(txt|.docx)../..
use regular expressions for searching. List files with the .txt or .docx extensions
9.-S is the sort options
10.-Sx
Sort files in ascending order
11.-RSx Sort files in reverse order
12. fileusage -sc+w
-s option - Summarizes each group
13. fileusage -sc+w ../..
14. fileusage -sc+wx \.(txt|docx)../..
15.-v option lists detailed report by extension. The reason v is used is for verbose. The definition for verbose is using or expressed in more words than are needed
Project Description
Create a C++20 Windows console application that lists file usage. Files will be counted, and their sizes totaled. Files will be grouped by file extension.
Program Interfaces
The program should have the following command-line interface:
fileusage [-switches][--help][folder]
Where:
switches
o h (display help)
o r (reverse order of listing)
o s (sort by size)
o x (regex)
--help (display help)
folder is root directory.
The files should be listed in alphabetical order of the extension.
Switches
h: shows the help usage for running the program
r: list the files in reverse order.
s: sort the files by ascending file size (not extension name) or descending if the r switch is also provided.
x: limit the search to only the files that match the extensions specified by a regex expression
(i.e.: -x "\.(docx|xlsx)")
Default
If there are no switches or folder specified, the program will run recursively, in the current directory showing files with all file types listed in alphabetical order by extension without the directory listing.
Functional Requirements
Passes #1: fileusage --help
Passes #2: fileusage -h
Passes #3: current folder, no args: no files or folders
Passes #4: current folder: single file, no subfolders
Passes #5: current folder: multiple file, no subfolders
Passes #6: current folder -r: multiple file, no subfolders
Passes #7: current folder -s: multiple files, no subfolders
Passes #8: current folder -sr: multiple files, no subfolders
Passes #9: current folder -x "\.(exe|html)": multiple files, no subfolders
Passes #10: current folder: multiple files, one subfolder
Passes #11: current folder: multiple files, subfolders
Passes #12: current folder -sr: multiple files, subfolders
Passes #13: specified folder
Passes #14: specified folder with -sr
Survives: fileusage c:\
Listings are right aligned columns
Expectations Students will: Design the data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!