2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: renameDirectory.c,v 1.1 1998/04/10 10:54:47 simonm Exp $
6 * renameDirectory Runtime Support
12 #ifdef HAVE_SYS_TYPES_H
13 #include <sys/types.h>
16 #ifdef HAVE_SYS_STAT_H
21 renameDirectory(StgByteArray opath, StgByteArray npath)
25 /* Check for an actual directory */
26 while (stat(opath, &sb) != 0) {
33 if (!S_ISDIR(sb.st_mode)) {
34 ghc_errtype = ERR_INAPPROPRIATETYPE;
35 ghc_errstr = "not a directory";
38 while(rename(opath, npath) != 0) {