Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started