bogocopy

Safe HaskellNone
LanguageHaskell2010

Main

Synopsis

Documentation

debugRef :: IORef Bool Source #

naughty. shift these into a reader monad or something.

depth :: FilePath -> Int Source #

number of levels in a path

replaceDir :: String -> String -> String -> String Source #

basically, makes srcFile relative to srcDir, then substitutes in dstDir instead.

will throw exception on empty strings.

replaceDir' :: Text -> Text -> Text -> Text Source #

replaceDir' - version for Text

eitherFiles :: FindClause Bool -> (Text -> Text -> Sh a) -> (Text -> Text -> Sh a) -> Text -> Text -> Sh ([a], [a]) Source #

eitherFiles pred f g src dst -- where src and dst are directory names, will process all the files under src according to pred. If they pass, it processes them with "f" (takes the src file path and the dest file path), otherwise with "g".

eitherFiles_ :: FindClause Bool -> (Text -> Text -> Sh ()) -> (Text -> Text -> Sh ()) -> Text -> Text -> Sh () Source #

same as eitherFiles, but return Sh ().

eitherDirs :: FindClause Bool -> (Text -> Text -> Sh a) -> (Text -> Text -> Sh b) -> Text -> Text -> Sh ([a], [b]) Source #

filtSplitFiles :: MonadIO m => FindClause Bool -> FindClause Bool -> (Text -> Text -> m a) -> (Text -> Text -> m b) -> Text -> Text -> m ([a], [b]) Source #

filtSplitFiles filterPred splitPred f g src dst:

iterate over the files in directory src. filter for ones matching filterPred, discarding all others. then split them into 2 - those matching splitPred, and those not. On those that do, execute f, on the others, execute g. Return the results

bogoCopy :: FindClause Bool -> Text -> Text -> Sh () Source #

bogoCopy pred srcDir dstDir: make a clone of srcDir at dstDir; but if a file passes "pred", then make a real copy, but if not, just make a zero-size sparse file with the same name and attributes. bogoCopy :: System.FilePath.Find.FindClause Bool

fileSize' :: FilePath -> IO FileOffset Source #

FilePath version of fileSize

hasSize :: (FileOffset -> b) -> FilePath -> IO b Source #

real_cp :: Text -> Text -> Sh () Source #

zero_cp :: Text -> Text -> Sh () Source #

time_cp :: Text -> Text -> Sh () Source #

tree_cp :: Text -> Text -> Sh () Source #

make copy of directory tree. should preserve modification times, ownership/permissions

mainSh :: String -> String -> COff -> IO () Source #

src and dst are source and dest dirs. maxSize is size less than which, in MB, we should make real copies

main :: IO () Source #