let rec print_directory inode dirname = let p = inode.partition in let fd = open_inode inode in try while true do let (i, name) = read_dirent fd in let filename = Filename.concat dirname name in Printf.printf "%s\n" filename; let inode = read_inode p i in match inode.stats.st_kind with S_REG -> () | S_DIR -> if name <> "." && name <> ".." then print_directory inode filename done with End_of_file -> () |