Question: 1. write a files counter (named filecnt ) program in c++ filecnt accepts one argument which is the path of a directory in a Unix
1. write a files counter (named filecnt) program in c++
filecnt accepts one argument which is the path of a directory in a Unix file system.
The minimum requirement is that filecnt can accept and process an absolute path, but if your program can accept and process other forms of paths (e.g. relative path, '~' expansion, etc...) extra credit points will be given. If you implement these extra features they must be clearly documented to receive extra credit points.
The program then recursively explores (traverses) the given directory and counts 1) the total number of directories, 2) the total number of plain files (i.e. not directory), and 3) the total number of bytes occupied by those plain files. If an entry in a directory is not accessible (no permission to access), or an entry is a link to another location of the file system, the program should skip (i.e. do not count) that entry. Counting hidden files is optional.
After processing the given directory, the program should output the following text to the standard output:
The total number of directories in directory
The total number of files in directory
The total number of bytes occupied by all files in directory
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
