The following program is a simple version of the ls command that lists the files in a directory. It takes no options. If a path argument is given, it lists the contents of that directory; otherwise, it lists the contents of the current directory.
The program demonstrates the following library calls:
The complete source code and Makefile for these programs is available as a zip file.