KAIST
EE309: Advanced Programming Techniques for EE

Assignment 1: A Directory Listing Program (ls309)

 

Overview

ls (list), which is the utility commonly found in Unix-like operating systems, is used to display a list of files and directories in a specified location, providing options to control the display targets or format. In this project, you will be tasked with implementing your own simplified version of ls.

Rules

Make sure you check the general guide for assignment and the course policy web page before doing this assignment or any of the EE309 assignments. In particular, note that you may consult with the course instructor, TAs, etc. while doing assignments, as prescribed by that web page.

Specifications

A. Inputs

B. Outputs

C. Options

D. Etc

Notes: We provide the sample reference program samplels309. Your program should follow the behavior of a reference program for ambiguous or undocumented specifications. The grading will be done by comparing the output of this reference program and yours. Do not try to debug or reverse engineer the given reference program since it is obfuscated to prevent such tries.

Implementation

The given skeleton code (Updated on Sep 6, 6124bf773e452d5b739199f15a4fcba2) was mainly designed with four tasks: 1) Option parsing & Entries sorting, 2) Directory listing and Support -a option, 3) Support -l option, 4) Support -R option. You can search // TODO from the given skeleton code to locate each task's implementation points.

  1. Option parsing & Entries sorting
  2. Directory listing and Support -a option
  3. Support -l option
  4. Support -R option
For error handling, check the return values of library functions in your overall implementations and print the proper error message into stderr. You may want to use the errno variable and perror/strerror functions. For the robustness of your program, always be aware of memory-related bugs in your implementation. You may use Valgrind or Address Sanitizer to detect whether your program has a memory bugs and leaks. You can pass all test cases from test-error if your program correctly handles errors and is bulletproof from memory error and memory leaks.

Submission

A. Platform

B. File structure

Logistics

Criteria

A. Scoring

B. Test environment

If your submission file does not contain the expected files, or your code cannot be compiled at eelabg12 (Haedong lounge server) with gcc209 compiler, we cannot give you any points. Please double check before you submit.