In this assignment, each student is to write a program that provides a file listing for the given directory. The program should list the filename, file size, and time last modified for each file within the directory. The program should provide the user with the option to sort the listing based on filename, on file size, or on time last modified. The program should run once and quit (it does not loop).
The syntax (usage) for the program should be:
prog_name [directory] [[-s][-t]]
where –s indicates sort by file size and –t indicates sort by time last modified. These flags are optional but mutually exclusive. The directory is also optional; if it is omitted than a default directory of “.” (the current directory) should be assumed. Every possible combination of command line arguments, from the above syntax, will be tested.