Answered step by step
Verified Expert Solution
Link Copied!

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
2. The first argument is an option started with a dash -. Legitimate options are -a
and -l.
3. If -a is giving, you need to list all files including hidden file start with ..
4. 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.
5. If no dash option is given, you only list file names with hidden file excluded.
6. 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.
7. Your project submission should include the implementation files myls.c, header file
(optional), Makefile (optional), and a README file.
8. All the file names need to be listed in ascending order. You can compare the outputs
with real ls.
II. Important:
1. 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.
2. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago