(* recherche de fichiers ou répertoires *) type repertoire = |Nil |Fichier of string |Noeud of (string*(repertoire list)) ;; let rep1=Noeud ("racine", [ Fichier "cours"; Fichier "TD"; Noeud ("divers",[ Fichier"TIPE"; Fichier "colles"] ) ] );; let rec cherche_rep disque repertoire = match disque with |Nil -> print_string "il n'est pas là";print_newline() |Fichier s -> print_string "il n'est pas là";print_newline() |Noeud (nomr, sousrep) -> if (nomr=repertoire) then (print_string "il est là") else let fouille sr =cherche_rep sr repertoire in do_list fouille sousrep ;; cherche_rep rep1 "divers";; cherche_rep rep1 "diers";; let rec cherche_fichier disque nomf = match disque with |Nil -> print_string "il n'est pas là";print_newline() |Fichier s -> if (s=nomf) then (print_string "il est là"; print_newline()) else print_string "pas là"; print_newline() |Noeud (nomr, sousrep) -> let fouille rep =cherche_fichier rep nomf in do_list fouille sousrep ;; cherche_fichier rep1 "diers";; cherche_fichier rep1 "TIPE";;