remove unused functions from Utility.RawFilePath

This commit is contained in:
Joey Hess 2025-02-11 13:49:17 -04:00
parent f8bb9a8734
commit 780a379ab1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 1 additions and 28 deletions

View file

@ -22,12 +22,8 @@ module Utility.RawFilePath (
readSymbolicLink,
createSymbolicLink,
createLink,
removeLink,
getFileStatus,
getSymbolicLinkStatus,
doesPathExist,
getCurrentDirectory,
createDirectory,
setFileMode,
setOwnerAndGroup,
rename,
@ -38,18 +34,6 @@ module Utility.RawFilePath (
#ifndef mingw32_HOST_OS
import Utility.FileSystemEncoding (RawFilePath)
import System.Posix.Files.ByteString
import qualified System.Posix.Directory.ByteString as D
-- | Checks if a file or directory exists. Note that a dangling symlink
-- will be false.
doesPathExist :: RawFilePath -> IO Bool
doesPathExist = fileExist
getCurrentDirectory :: IO RawFilePath
getCurrentDirectory = D.getWorkingDirectory
createDirectory :: RawFilePath -> IO ()
createDirectory p = D.createDirectory p 0o777
#else
import System.PosixCompat (FileStatus, FileMode)
@ -89,15 +73,6 @@ getSymbolicLinkStatus :: RawFilePath -> IO FileStatus
getSymbolicLinkStatus p = P.getSymbolicLinkStatus . fromRawFilePath
=<< convertToWindowsNativeNamespace p
doesPathExist :: RawFilePath -> IO Bool
doesPathExist = D.doesPathExist . fromRawFilePath
getCurrentDirectory :: IO RawFilePath
getCurrentDirectory = toRawFilePath <$> D.getCurrentDirectory
createDirectory :: RawFilePath -> IO ()
createDirectory = D.createDirectory . fromRawFilePath
setFileMode :: RawFilePath -> FileMode -> IO ()
setFileMode p m = do
p' <- fromRawFilePath <$> convertToWindowsNativeNamespace p