42's project, re-implement ls
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Fabien Stadelwieser 6a39a5295b
Readme done
2 months ago
inc cc 1 year ago
lib/libft cc 1 year ago
src cc 1 year ago
.function_whitelist.txt all: first push 1 year ago
.gitignore all: structure prototyped 1 year ago
Makefile Last push ?? 1 year ago
README.md Readme done 2 months ago
author requirement: author file compilent to new verison 1 year ago

README.md

ft_ls

Reimplementation of a Darwin ls.

./ft_ls [-lRartcfuUSG] [FILES]

Implemented :

  • -l : long format
  • -R : recursive, list subdirectories
  • -a : all, show entries starting with .
  • -r : reverse sort
  • -t : sort by time

Bonus :

  • -c : sort time by ctime
  • -f : enable -aU
  • -u : sort time by access time
  • -U : do not sort, list directory in order
  • -S : sort by file size
  • -G : don't print group names

Install

Only on MacOS, not compatible with Linux because of the ACL and other ABI.

git clone ssh://git@git.42l.fr:42084/Fabien/ls.git
cd ls
make

Could have made it Linux compatible if the school wasn't forbidding #indef in the norm :

#ifdef __LINUX__ // Forbidden
    linux_syscall();
#elif __APPLE__ // Forbidden
    darwin_syscall();
#endif

How it's done

It's basically a complicated wrapper around readdir syscal.

man readdir
man opendir
man closedir

Credit

Student project for School 42.

Realized in about a week with cvignal.

Final Grade: 118/125