X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverUtil.hs;h=4932b9e48e132012e942c9525c04e57e04694591;hb=70b6c54b3c140d96b69287f8f400f88a0b7e9c18;hp=17eb663e614b67e145d8be399cbc1b09c9a015ce;hpb=06575d67c6e85ee746d96c77dab9e40edfb4f7ee;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs index 17eb663..4932b9e 100644 --- a/ghc/compiler/main/DriverUtil.hs +++ b/ghc/compiler/main/DriverUtil.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverUtil.hs,v 1.35 2002/10/17 14:26:18 simonmar Exp $ +-- $Id: DriverUtil.hs,v 1.38 2003/06/04 15:47:59 simonmar Exp $ -- -- Utils for the driver -- @@ -16,11 +16,12 @@ import Util import Panic import Config ( cLeadingUnderscore ) -import EXCEPTION as Exception +import EXCEPTION ( Exception(..), finally, throwDyn, catchDyn, throw ) +import qualified EXCEPTION as Exception import DYNAMIC import DATA_IOREF ( IORef, readIORef, writeIORef ) -import Directory ( getDirectoryContents, doesDirectoryExist ) +import Directory import IO import List import Char @@ -69,6 +70,16 @@ softGetDirectoryContents d ) ----------------------------------------------------------------------------- +-- Create a hierarchy of directories + +createDirectoryHierarchy :: FilePath -> IO () +createDirectoryHierarchy dir = do + b <- doesDirectoryExist dir + when (not b) $ do + createDirectoryHierarchy (directoryOf dir) + createDirectory dir + +----------------------------------------------------------------------------- -- Verify that the 'dirname' portion of a FilePath exists. -- doesDirNameExist :: FilePath -> IO Bool