let rec read_dirent desc = let dirent = String.create dirent_size in (* note that our read always read the desired quantity, except when the end of file is reached. *) let nread = read desc dirent 0 dirent_size in if nread = 0 then raise End_of_file else if dirent.[0] = '\000' then read_dirent desc else let inode = read_int dirent filename_max_size in dirent.[filename_max_size] <- '\000'; inode, String.sub dirent 0 (String.index dirent '\000') |