[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:50:30 UTC 2010
The following commit has been merged in the master branch:
commit bd8af5574b8876209c3d645bd174d1a49b843dfd
Author: John Goerzen <jgoerzen at complete.org>
Date: Fri Dec 10 00:09:48 2004 +0100
Added recursive directory support
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-57)
diff --git a/ChangeLog b/ChangeLog
index f67cc25..34cf79a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-09 17:09:48 GMT John Goerzen <jgoerzen at complete.org> patch-57
+
+ Summary:
+ Added recursive directory support
+ Revision:
+ missingh--head--0.7--patch-57
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/Path.hs
+
+
2004-12-09 16:55:41 GMT John Goerzen <jgoerzen at complete.org> patch-56
Summary:
diff --git a/libsrc/MissingH/Path.hs b/libsrc/MissingH/Path.hs
index d5de0dc..9b06a2d 100644
--- a/libsrc/MissingH/Path.hs
+++ b/libsrc/MissingH/Path.hs
@@ -64,6 +64,8 @@ item is always present in the returned list.
If the passed value is not a directory, the return value
be only that value.
+
+The \".\" and \"..\" entries are removed from the data returned.
-}
recurseDir :: FilePath -> IO [FilePath]
recurseDir x = recurseDirStat x >>= return . map fst
@@ -75,7 +77,7 @@ yourself later.
recurseDirStat :: FilePath -> IO [(FilePath, FileStatus)]
recurseDirStat fn =
- do fs <- getFileStatus fn
+ do fs <- getSymbolicLinkStatus fn
if isDirectory fs then do
dirc <- getDirectoryContents fn
let contents = map ((++) (fn ++ "/")) $
@@ -84,7 +86,16 @@ recurseDirStat fn =
return $ (concat subdirs) ++ [(fn, fs)]
else return [(fn, fs)]
-
-
-
-
\ No newline at end of file
+{- | Removes a file or a directory. If a directory, also removes all its
+child files/directories.
+-}
+recursiveRemove :: FilePath -> IO ()
+recursiveRemove fn =
+ let worker [] = return ()
+ worker ((fn, fs):xs) =
+ do if isDirectory fs then
+ removeDirectory fn
+ else removeFile fn
+ worker xs
+ in
+ recurseDirStat fn >>= worker
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list