Question: Your program should take two possible command line arguments. For example . / myls - a ~ / Document 2 . The first argument is
Your program should take two possible command line arguments. For example
myls a ~Document
The first argument is an option started with a dash Legitimate options are a
and l
If a is giving, you need to list all files including hidden file start with
If l is giving, you need to list one file per line with detailed information file type,
permission, link number, user, group, size, modification time, and file name The
format should be the same as the real ls l
If no dash option is given, you only list file names with hidden file excluded.
The second argument is a path relative or absolute to a directory. If present, list
the files in the specified directory. If no second argument is given, list the files in
current directory.
Your project submission should include the implementation files mylsc header file
optional Makefile optional and a README file.
All the file names need to be listed in ascending order. You can compare the outputs
with real ls
II Important:
You will need to do your own research on how to use masking, getpwuid
getgrgid ctime to decode the file type, permission, user name, group name,
modification time in the stat structure.
You can write your own sorting function or research on how to use qsort
III. Grading Criteria:
Please make sure your program compiles, otherwise your submission will not be
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
