+#if defined(__HUGS__)
+ (bracket (openBinaryFile fromFPath ReadMode) hClose $ \hFrom ->
+ bracket (openBinaryFile toFPath WriteMode) hClose $ \hTo -> do
+ hGetContents hFrom >>= hPutStr hTo
+ try (getPermissions fromFPath >>= setPermissions toFPath)
+ return ()) `catch` \err ->
+ ioError (annotateIOError err "copyFile" Nothing Nothing)
+#elif (!defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ <= 600)