LS implementation in C

Completed Posted 3 years ago Paid on delivery
Completed Paid on delivery

ls: Implement ls in C

Overview and Goal

The goal of this task is to write your own implementation of the GNU/Linux ls

command in the C programming language.

Of course, not all the functionality of the original ls has to be

implemented: Your program must only behave like the original, invoked with -1

and -F. It must also support a single, optional parameter specifying the

file or directory to be listed. If this parameter is not given, the contents

of the current directory are listed. Otherwise, either the single file, or the

contents of the given directory are listed.

Expected Output

The program must have the exact same behavior as the GNU/Linux ls command

with the options -1 and -F.

Important: Directories are listed with / at the end, executable files with

* and symlinks with @! See man ls for more details.

The following is an example output of GNU/Linux ls:

$ ls -1 -F

ls*

ls.c

Makefile

[login to view URL]

symlink@

Invocation without Parameter

If invoked without any parameter, the contents of the current directory are

listed:

$ ./ls

ls*

ls.c

Makefile

[login to view URL]

symlink@

Invocation with Optional Directory

If a directory is given as parameter, its contents are listed:

$ ./ls ..

1-hello/

2-base64/

3-ls/

4-sort/

5-shell/

[login to view URL]

[login to view URL]

Invocation with Optional File

If a file is given as parameter, only the file is listed:

$ ./ls /etc/hostname

/etc/hostname

Evaluation

Total points possible: 5

Minimum number of points required to pass: 4

Points can be obtained as follows:

1 Point: Invocation without any parameter in any directory

1 Point: Invocation with any directory as parameter

1 Point: Invocation with any file as parameter

1 Point: Correct identification of directories ("/") and executables ("*")

1 Point: Correct identification of symlinks ("*")

the source has to compile with the attached makefile!

C Programming C++ Programming Linux Software Architecture UNIX

Project ID: #28984355

About the project

2 proposals Remote project Active 3 years ago

Awarded to:

shahzadiftkhar

Hi, I have a professional experience of over 3 years working in C/C++ and have worked on projects related to system programming during my university tenure, have done pretty much similar tasks like this (creating custo More

€200 EUR in 4 days
(4 Reviews)
1.9

2 freelancers are bidding on average €140 for this job

nikhilb3380

please discuss. Negotiable price and duration...........................................................................................................................................................

€80 EUR in 3 days
(0 Reviews)
0.0