As simple as listing the files in a directory.
  • C 85.6%
  • Makefile 14.4%
Find a file
dyn 03f3de1064
🚧 wip: push tracking, will delete all of this anyway
Signed-off-by: dyn <contact@dynamicdispat.ch>
2026-04-27 07:10:14 +02:00
include/ls 🚧 wip: push tracking, will delete all of this anyway 2026-04-27 07:10:14 +02:00
libft@6675f73e27 feature: initial commit 2024-03-10 06:03:51 +01:00
src 🚧 wip: push tracking, will delete all of this anyway 2026-04-27 07:10:14 +02:00
.gitignore feature: initial commit 2024-03-10 06:03:51 +01:00
.gitmodules feature: initial commit 2024-03-10 06:03:51 +01:00
Makefile feature: initial commit 2024-03-10 06:03:51 +01:00
README.md 🚧 wip: push tracking, will delete all of this anyway 2026-04-27 07:10:14 +02:00
testgetopt.c 🚧 wip: push tracking, will delete all of this anyway 2026-04-27 07:10:14 +02:00
tests.md feature: initial commit 2024-03-10 06:03:51 +01:00

ft_ls

For knowing the filesystem inside out, and how files and directories are sorted, you will code by yourself one of the most used command: ls.

Features

Mandatory features:

  • Support of the following flags/options:
    • -l, displays the files in a column style, showing more information
    • -a, displays hidden files too
    • -r, reverses the order of the files
    • -t, sorts files based on their last modified time
    • -R, displays subfolder contents recursively
  • An identical as possible display to the original ls

Bonus stuff:

  • Management of ACL & extended attributes
  • Management of columns without -l (using /dev/tty and ioctl)
  • Usage of the LS_COLORS environment variable and the --color flag
  • Support of the following flags/options:
    • --zero, ends each line with a NUL character, not a newline
    • -A, displays almost all hidden files (this excludes . and ..)
    • -1, lists only one file per line

Bonus functions

Since the subject allows for uses of other functions for the bonus part, here are the functions used:

function name header usage
ioctl <sys/ioctl.h> getting the current TTY's display size

References