Bonjour,
Je souhaite créer un programme en C qui s'apparente au "ls" sous Linux
car je souhaite lister les fichiers et répertoires d'un chemin indiqué
ou du dossier courant si on ne préçise pas de chemin et avec options
possibles :
-l
-R
Ces options doivent pouvoir être passées dans un sens quelconque.
Sans l'option -l , on ne gère pas le formatage en collones.
Sans option, on affiche une liste de fichier.
Il doit être capable de faire un "ls -l /dev /usr/sbin".
Exemples:
$>
./my_ls -l -R
total 4
-rw------- 1 astek operator 606 Oct 29 10:45 #myls#
-rw-r--r-- 1 astek
prof 860 Oct 19 11:11
bdsh
-rw-r--r-- 2 astek operator 830 Oct 13 14:11 bdsh~
-rwxr-xr-x 1 astek operator 497 Oct 13 14:00 stream.a*
$>
./my_ls -Rl ~astek/doc
total 299
drwx------ 2 astek
prof 512 Jul 16
1999 Autres
-rw-r--r-- 1 astek
prof 4892 Oct 27 1999
faq
-rwxr-xr-x 1 astek
prof 3147 Oct 9 16:22
gdb.html
-rw-r--r-- 1 astek
prof 253956 Jul 27 1999 livre.pdf
-rwxr-xr-x 1 astek prof 10336 Oct 20 10:35 norme
-rw-r--r-- 1 astek
prof 7490 Sep 17 1999
old_norme
-rw-r--r-- 1 astek
prof 3184 Sep 30 10:31
planning
-rwxr-xr-x 1 astek
prof 1470 Mar 24 2000
soutenances
$>
./my_ls ./lib
iob
libextra_NetBSD.a
libmlx_NetBSD.a
libmlx_alpha.a
libmy_NetBSD.a
libmy_alpha.a
libmy_list_NetBSD.a
lmd
my
my_btree
my_list

Je vous avoue être un peu perdu, donc toutes aides me seraient les bienvenues !!!
Par avance UN ENORME
MERCI !!