Question: Please help me write this C function. Please provide screenshots of your code and output since it is easier to see the format that way.

Please help me write this C function. Please provide screenshots of your code and output since it is easier to see the format that way. Thank You!

Please help me write this C function. Please provide screenshots of your

code and output since it is easier to see the format that

List Files: Write a program named myls.c that lists files in the given directory. When called without any arguments, the program should just print the file names. When invoked with the -1 flag, the program should print out the owner permissions, inode number, and file name information obtained from the stat() system call. The progranm should take one additional argument on the command line, which is the directory to read, e.g., myls -1 directory. If no directory argument is given on the command line, the program should just use the current working directory YOU MUST USE THESE INTERFACES: stat), opendir(), readdir), getcwd() Here is an example of how your code should work $ 1s Makefile myls myls.c tempdir $ ./myls tempdir Makefile myls.c $ ls tempdir baz.txt /myls tempdir baz.txt $ 1s Makefile myls myls.c tempdir $ ./myls tempdir Makefile myls.c The files can be listed in any order, and it will be easiest if you include the '.' and '.' entries in the output. Note that directory names are included in the output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!