2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: removeDirectory.c,v 1.3 1998/12/02 13:27:47 simonm Exp $
6 * removeDirectory Runtime Support
12 #ifdef HAVE_SYS_TYPES_H
13 #include <sys/types.h>
16 #ifdef HAVE_SYS_STAT_H
26 /* Check for an actual directory */
27 while (stat(path, &sb) != 0) {
34 if (!S_ISDIR(sb.st_mode)) {
35 ghc_errtype = ERR_INAPPROPRIATETYPE;
36 ghc_errstr = "not a directory";
39 while (rmdir(path) != 0) {
48 ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
49 ghc_errstr = "directory not empty";