darcs-2.16.5: a distributed, interactive, smart revision control system

Safe Haskell | Safe-Inferred
Language | Haskell2010

Darcs.Util.External

Synopsis

- cloneTree :: FilePath -> FilePath -> IO ()
- cloneFile :: FilePath -> FilePath -> IO ()
- fetchFilePS :: String -> Cachable -> IO ByteString
- fetchFileLazyPS :: String -> Cachable -> IO ByteString
- gzFetchFilePS :: String -> Cachable -> IO ByteString
- speculateFileOrUrl :: String -> FilePath -> IO ()
- copyFileOrUrl :: String -> FilePath -> FilePath -> Cachable -> IO ()
- data Cachable
  - = Cachable
  - | Uncachable
  - | MaxAge !CInt
- backupByRenaming :: FilePath -> IO ()
- backupByCopying :: FilePath -> IO ()

# Documentation

cloneTree :: FilePath -> FilePath -> IO () #

cloneFile :: FilePath -> FilePath -> IO () #

fetchFilePS :: String -> Cachable -> IO ByteString #

`fetchFile fileOrUrl cache` returns the content of its argument (either a file or an URL). If it has to download an url, then it will use a cache as required by its second argument.

We always use default remote darcs, since it is not fatal if the remote darcs does not exist or is too old -- anything that supports transfer-mode should do, and if not, we will fall back to SFTP or SCP.

fetchFileLazyPS :: String -> Cachable -> IO ByteString #

`fetchFileLazyPS fileOrUrl cache` lazily reads the content of its argument (either a file or an URL). Warning: this function may constitute a fd leak; make sure to force consumption of file contents to avoid that. See "fetchFilePS" for details.

gzFetchFilePS :: String -> Cachable -> IO ByteString #

speculateFileOrUrl :: String -> FilePath -> IO () #

copyFileOrUrl #

Arguments

:: String | remote darcs executable
-> FilePath | path representing the origin file or URL
-> FilePath | destination path
-> Cachable | tell whether file to copy is cachable
-> IO () |

data Cachable #

Constructors

Cachable |
Uncachable |
MaxAge !CInt |

#### Instances

Instances details

Show Cachable # |
Instance details Defined in Darcs.Util.Download.Request Methods showsPrec :: Int -> Cachable -> ShowS # show :: Cachable -> String # showList :: [Cachable] -> ShowS #
Eq Cachable # |
Instance details Defined in Darcs.Util.Download.Request Methods (==) :: Cachable -> Cachable -> Bool # (/=) :: Cachable -> Cachable -> Bool #

backupByRenaming :: FilePath -> IO () #

backupByCopying :: FilePath -> IO () #