System function ls is recoded on this git repository.
From BSD General Commands Manual:
NAME
ls -- list directory contents
SYNOPSIS
ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]
DESCRIPTION
For each operand that names a file of a type other than directory, ls displays its name as well as any requested,
associated information. For each operand that names a file of type directory, ls displays the names of files con-
tained within that directory, as well as any requested, associated information.
If no operands are given, the contents of the current directory are displayed. If more than one operand is given,
non-directory operands are displayed first; directory and non-directory operands are sorted separately and in lexico-
graphical order.
for more information search in BSD General Commands Manual.
However the synopsis of my ls is:
./ft_ls [-lRartufgds1] [file ...]
To compile a binary that will list directories you should do make
. After what you can watch through any directory (if you have such permisions of course).
To inititalise ft_ls you should write:
./ft_ls
That's it! Every option (such as -l or -a) is implemented due to the option of original ls, so u can watch how it works and compare with my function!
Images of original ls and ft_ls:
Additional info:
Makefile functions:
make/make all
- compiles a binary namedft_ls
;make clean
- removes every object file fromobj
directory;make fclean
- the same asmake clean
+ removes binary fileft_ls
;make re
- the same asmake fclean
+make
.