Question: Please write a C code with online gdb . com, that can run with the following zipped file is _ test _ files.Please show proof

Please write a C code with online gdb.com, that can run with the following zipped file is_test_files.Please show proof of output and explain how to run the code with the uploaded file to get the output!
What to do?
Write a C program myls 1 whose behavior resembles that of the system command 1s. myls 1 must
accept the following parameters:
$ myls1[-ars][directory]
If myls1 is provided with no parameters, it lists the names of all files in the current directory, one file
name per line.
directory specifies the name of a directory, in which case myls1 lists the names of files within that
directory.
-a switch forces myls 1 to display the names of hidden files (whose names start with a "."). In the
absence of this switch, hidden files are not listed.
-s switch sorts the filenames in the lexicographical order.
-r switch sorts the filenames in the reverse lexicographical order.
You must use system calls opendir(), readdir(), and closedir().
Hint: consider using an array of strings to store the list of file names and then sorting it using qsort ().
Test my1.s1 using the files archived in this ZIP file, which contains several nested directories (named
dirA,dirB, and dirA1, each with a number of short text files (named file*.txt). Use the following
test cases when running myls1 from the directory at the same level with dirA and dirB:
What to submit?
A single C source code file with your work.
Several screenshots (in PNG or JPG format) showing the results of executing the test cases listed above
on a Linux terminal.
 Please write a C code with online gdb.com, that can run

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!