Question: Using Onlinegdb, write a c code. Also i need the code to be a able to run a zipped file called Is _ test _

Using Onlinegdb, write a c code.
Also i need the code to be a able to run a zipped file called Is_test_files.zip
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.
 Using Onlinegdb, write a c code. Also i need the code

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!