more OsPath conversion
Sponsored-by: Leon Schuermann
This commit is contained in:
parent
ee0964e61b
commit
f3539efc16
18 changed files with 156 additions and 153 deletions
|
@ -14,11 +14,10 @@ module Utility.Path.Windows (
|
|||
|
||||
import Utility.Path
|
||||
import Utility.OsPath
|
||||
import Utility.FileSystemEncoding
|
||||
import Utility.SystemDirectory
|
||||
|
||||
import qualified Data.ByteString as B
|
||||
import qualified System.FilePath.Windows.ByteString as P
|
||||
import System.Directory (getCurrentDirectory)
|
||||
|
||||
{- Convert a filepath to use Windows's native namespace.
|
||||
- This avoids filesystem length limits.
|
||||
|
@ -36,8 +35,8 @@ convertToWindowsNativeNamespace f
|
|||
| otherwise = do
|
||||
-- Make absolute because any '.' and '..' in the path
|
||||
-- will not be resolved once it's converted.
|
||||
cwd <- toRawFilePath <$> getCurrentDirectory
|
||||
let p = fromOsPath (simplifyPath (toOsPath (combine cwd f)))
|
||||
cwd <- getCurrentDirectory
|
||||
let p = fromOsPath (simplifyPath (combine cwd (toOsPath f)))
|
||||
-- Normalize slashes.
|
||||
let p' = P.normalise p
|
||||
return (win32_file_namespace <> p')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue