2 % (c) The GRASP/AQUA Project, Glasgow University, 1998
4 \subsection[directoryAux.lc]{Support functions for manipulating directories}
11 #ifdef HAVE_SYS_TYPES_H
12 #include <sys/types.h>
15 #ifdef HAVE_SYS_STAT_H
30 /* Check for an actual directory */
31 while (stat(path, &sb) != 0) {
38 if (!S_ISDIR(sb.st_mode)) {
39 ghc_errtype = ERR_INAPPROPRIATETYPE;
40 ghc_errstr = "not a directory";
44 while ((dir = opendir(path)) == NULL) {
59 while ((d = readdir((DIR*)dir)) == NULL) {
61 (void) closedir((DIR*)dir);
63 } else if (errno != EINTR) {
66 (void) closedir((DIR*)dir);