2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
4 \subsection[createDirectory.lc]{createDirectory Runtime Support}
11 #ifdef HAVE_SYS_TYPES_H
12 #include <sys/types.h>
15 #ifdef HAVE_SYS_STAT_H
26 while((rc = mkdir(path, 0777)) != 0) {
35 ghc_errtype = ERR_NOSUCHTHING;
36 ghc_errstr = "no path to directory";
39 if (stat(path, &sb) != 0) {
40 ghc_errtype = ERR_OTHERERROR;
41 ghc_errstr = "cannot stat existing file";
43 if (S_ISDIR(sb.st_mode)) {
44 ghc_errtype = ERR_ALREADYEXISTS;
45 ghc_errstr = "directory already exists";
47 ghc_errtype = ERR_INAPPROPRIATETYPE;
48 ghc_errstr = "file already exists";