LS

Read

man: see bellow.

What you should learn from this project

  • How does ls work?
  • what are all the functions used by ls

Requirements

  • Allowed editors: vi, vim, emacs
  • All your files will be compiled on Ubuntu 14.04 LTS
  • Your C programs and functions will be compiled with gcc 4.8.4 using the flags -Wall -Werror -Wextra and -pedantic
  • All your files should end with a new line
  • Your code should use the Betty style. It will be checked using betty-style.pl and betty-doc.pl
  • No more than 5 functions per file
  • All your header files should be include guarded
  • Valgrind should show 0 memory leak and 0 error
  • Unless specified otherwise, your program must have the exact same output as ls as well as the exact same error output - except for alignment.

List of authorized functions and system calls

  • opendir (man 3 opendir)
  • readdir (man 3 readdir)
  • closedir (man 3 closedir)
  • exit (man 3 exit)
  • free (man 3 free)
  • lstat (man 2 lstat)
  • malloc (man 3 malloc)
  • perror (man 3 perror)
  • write (man 2 write)
  • printf (man 3 printf)
  • readlink (man 2 readlink)
  • ctime (man 3 ctime)
  • getpwuid (man 3 getpwuid)
  • getgrgid (man 3 getgrgid)

Compilation

gcc -Wall -Werror -Wextra -pedantic *.c -o hls