use ByteStrings when reading annex symlinks and pointers
Now there's a ByteString used all the way from disk to Key. The main complication in this conversion was the use of fromInternalGitPath in several places to munge things on Windows. The things that used that were changed to parse the ByteString using either path separator. Also some code that had read from files to a String lazily was changed to read a minimal strict ByteString.
This commit is contained in:
parent
0a8d93cb8a
commit
5d98cba923
10 changed files with 128 additions and 78 deletions
28
Utility/RawFilePath.hs
Normal file
28
Utility/RawFilePath.hs
Normal file
|
@ -0,0 +1,28 @@
|
|||
{- Portability shim around System.Posix.Files.ByteString
|
||||
-
|
||||
- Copyright 2019 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- License: BSD-2-clause
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.RawFilePath (
|
||||
RawFilePath,
|
||||
readSymbolicLink,
|
||||
) where
|
||||
|
||||
#ifndef mingw32_HOST_OS
|
||||
import System.Posix.Files.ByteString
|
||||
import System.Posix.ByteString.FilePath
|
||||
#else
|
||||
import qualified Data.ByteString as B
|
||||
import System.IO.Error
|
||||
|
||||
type RawFilePath = B.ByteString
|
||||
|
||||
readSymbolicLink :: RawFilePath -> IO RawFilePath
|
||||
readSymbolicLink _ = ioError $ mkIOError illegalOperationErrorType x Nothing Nothing
|
||||
where
|
||||
x = "Utility.RawFilePath.readSymbolicLink: not supported"
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue