2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
4 \subsection[removeDirectory.lc]{removeDirectory Runtime Support}
11 #ifdef HAVE_SYS_TYPES_H
12 #include <sys/types.h>
15 #ifdef HAVE_SYS_STAT_H
25 /* Check for an actual directory */
26 while (stat(path, &sb) != 0) {
33 if (!S_ISDIR(sb.st_mode)) {
34 ghc_errtype = ERR_INAPPROPRIATETYPE;
35 ghc_errstr = "not a directory";
38 while (rmdir(path) != 0) {
47 ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
48 ghc_errstr = "directory not empty";