B-PSU-100 My Ls
B-PSU-100 My Ls
B-PSU-100
my_ls
LiSting command-like
2.3
my_ls
binary name: my_ls
language: C
compilation: via Makefile, including re, clean and fclean rules
• The totality of your source files, except all useless files (binary, temp files, obj
files,...), must be included in your delivery.
• All the bonus files (including a potential specific Makefile) should be in a directory
named bonus.
• Error messages have to be written on the error output, and the program should
then exit with the 84 error code (0 if there is no error).
∇ Terminal - + x
∼/B-PSU-100> ./my_ls -l -t
...
∼/B-PSU-100> ./my_ls -lRt
...
∼/B-PSU-100> ./my_ls -lt -R -t
∇ Terminal - + x
∼/B-PSU-100> ./my_ls -l /dev /usr/sbin
...
∼/B-PSU-100> ./my_ls -l -r file1 file2
...
Handling the column formatting without the -l option would be considered as a bonus
point, as well as sorting and coloring.
1
AUTHORIZED FUNCTIONS
The only system calls allowed are the following ones:
EXAMPLES
∇ Terminal - + x
∼/B-PSU-100> ./my_ls -l -R
.:
total 156
drwxr-xr-x 2 johan johan 4096 Nov 9 15:31 dir
-rwxr-xr-x 1 johan johan 151352 Nov 30 14:32 my_ls
-rw-r–r– 1 johan johan 0 Nov 9 15:30 ‘#test#’
-rw-r–r– 1 johan johan 80 Nov 9 15:30 test~
./dir:
total 0
-rw-r–r– 1 johan johan 0 Nov 9 15:31 test
2
∇ Terminal - + x
∼/B-PSU-100> ./my_ls /bin
bash date kmod nano su uncompress
bunzip2 dd less netstat sync vdir
bzcat df lessecho networkctl systemctl wdctl
bzcmp dir lessfile nisdomainname systemd which
bzdiff dmesg lesskey pidof systemd-ask-password wslpath
bzegrep dnsdomainname lesspipe ping systemd-escape ypdomainname
bzexe domainname ln ping4 systemd-hwdb zcat
bzfgrep echo login ping6 systemd-inhibit zcmp
bzgrep egrep loginctl ps systemd-machine-id-setup zdiff
bzip2 false ls pwd systemd-notify zegrep
bzip2recover fgrep lsblk rbash systemd-sysusers zfgrep
bzless findmnt lsmod readlink systemd-tmpfiles zforce
bzmore fuser mkdir rm systemd-tty-ask-password-agent zgrep
cat grep mknod rmdir tar zless
chgrp gunzip mktemp rnano tcsh zmore
chmod gzexe more run-parts tempfile znew
chown gzip mount sed touch
cp hostname mountpoint sh true
cpio ip mt sleep udevadm
csh journalctl mt-gnu ss umount
dash kill mv stty uname