[project @ 1998-02-02 17:27:26 by simonm]
[ghc-hetmet.git] / ghc / lib / cbits / renameDirectory.lc
diff --git a/ghc/lib/cbits/renameDirectory.lc b/ghc/lib/cbits/renameDirectory.lc
deleted file mode 100644 (file)
index 2a41186..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-%
-% (c) The GRASP/AQUA Project, Glasgow University, 1995
-%
-\subsection[renameDirectory.lc]{renameDirectory Runtime Support}
-
-\begin{code}
-
-#include "rtsdefs.h"
-#include "stgio.h"
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-StgInt
-renameDirectory(opath, npath)
-StgByteArray opath;
-StgByteArray npath;
-{
-    struct stat sb;
-
-    /* Check for an actual directory */
-    while (stat(opath, &sb) != 0) {
-       if (errno != EINTR) {
-           cvtErrno();
-           stdErrno();
-           return -1;
-       }
-    }
-    if (!S_ISDIR(sb.st_mode)) {
-       ghc_errtype = ERR_INAPPROPRIATETYPE;
-       ghc_errstr = "not a directory";
-       return -1;
-    }
-    while(rename(opath, npath) != 0) {
-       if (errno != EINTR) {
-           cvtErrno();
-           stdErrno();
-           return -1;
-       }
-    }
-    return 0;
-}
-\end{code}