Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program myls whose behavior resembles that of the system command ls. myls must print the names of files in the current directory

Write a C program myls whose behavior resembles that of the system command ls. myls must print the names of files in the current directory in columns of equal width. myls must accept the following parameters:

$ myls [-rs] 

-s switch sorts the filenames in alphabetical order. The file names must be arranged in sequence so that the names in column 1 are followed by the names in column 2, and so on.

-r switch sorts the filenames in the reverse alphabetical order.

When no switches are present, myls does not need to sort the file name.

Consider using the qsort() library function that implements the quicksort algorithm to sort an array.

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

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions

Question

Analyze the impact of labor unions on health care.

Answered: 1 week ago

Question

Assess three motivational theories as they apply to health care.

Answered: 1 week ago

Question

Discuss the history of U.S. labor unions.

Answered: 1 week ago