1 /***********************************************************************/
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
19 #include "unixsupport.h"
21 #include <sys/types.h>
24 typedef struct dirent directory_entry
;
27 typedef struct direct directory_entry
;
30 CAMLprim value
unix_readdir(value vd
)
35 if (d
== (DIR *) NULL
) unix_error(EBADF
, "readdir", Nothing
);
36 e
= readdir((DIR *) d
);
37 if (e
== (directory_entry
*) NULL
) raise_end_of_file();
38 return copy_string(e
->d_name
);