[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 15:02:53 UTC 2010
The following commit has been merged in the master branch:
commit 87807588ec1ba324fa67f698877ba7c53bc5b4d2
Author: John Goerzen <jgoerzen at complete.org>
Date: Sat Oct 1 20:34:59 2005 +0100
Maildir stuff
diff --git a/MissingH/Email/Mailbox/Maildir.hs b/MissingH/Email/Mailbox/Maildir.hs
index b8678f0..3ee0790 100644
--- a/MissingH/Email/Mailbox/Maildir.hs
+++ b/MissingH/Email/Mailbox/Maildir.hs
@@ -30,6 +30,7 @@ Support for Maildir-style mailboxes.
Information about the Maildir format can be found at:
* <http://www.qmail.org/qmail-manual-html/man5/maildir.html>
+
* <http://cr.yp.to/proto/maildir.html>
Written by John Goerzen, jgoerzen\@complete.org
@@ -44,24 +45,30 @@ import System.Directory
import MissingH.Path
import MissingH.Maybe
import Control.Monad
+import Text.Regex
data Maildir = Maildir
{loc :: FilePath}
instance Show Maildir
where show x = loc x
-
+
+splitFN fn :: String -> (String, Flags)
+
+splitFN fn =
+
+ where (base, fstr) =
+ case span (/= ':') of
+ (h, []) = (h, [])
+ (h, f) = (h, tail f)
{- | Open a Maildir mailbox. -}
-- For reading only, for now.
-readMaildir :: FilePath -> IO Maildir
-readMaildir fp =
+openMaildir :: FilePath -> IO Maildir
+openMaildir fp =
do cwd <- getCurrentDirectory
let abspath = forceMaybeMsg "abspath readMaildir" $ absNormPath cwd fp
c <- getDirectoryContents fp
unless ("cur" `elem` c && "new" `elem` c && "tmp" `elem` c)
$ error (fp ++ " is not a valid Maildir.")
- return (Maildir fp)
-
-
-
\ No newline at end of file
+ return (Maildir fp)
\ No newline at end of file
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list