Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module System.FilePath
- module Definitive
- createDirectoryIfMissing :: Bool -> FilePath -> IO ()
- (</>) :: FilePath -> FilePath -> FilePath
- followSymlink :: FilePath -> IO FilePath
- data FileAttrs
- lastMod :: Lens' FileAttrs (TimeVal Seconds)
- relPath :: Lens' FileAttrs FilePath
- data File
- data DirEntry = DirEntry FilePath File
- getFile :: FilePath -> IO File
- resource :: (?programName :: FilePath) => FilePath -> FilePath
- workingDirectory :: IO DirEntry
- data Location
- pathTo :: (?programName :: FilePath) => Location -> FilePath
- getConfig :: (?programName :: FilePath) => IO File
- newtype FS a = FS {}
- data Filesystem
- file :: String -> Lens' Filesystem File
- modTime :: FilePath -> IO (TimeVal Seconds)
- type PermMask = (Bool, Bool, Bool)
- data FilePermissions
- ownerPerms :: Lens' FilePermissions PermMask
- groupPerms :: Lens' FilePermissions PermMask
- otherPerms :: Lens' FilePermissions PermMask
- readPerm :: Lens' PermMask Bool
- writePerm :: Lens' PermMask Bool
- executePerm :: Lens' PermMask Bool
- runPermissionState :: FilePath -> State FilePermissions a -> IO a
- modifyPermissions :: FilePath -> (FilePermissions -> FilePermissions) -> IO ()
- getPermissions :: FilePath -> IO FilePermissions
- contents :: Traversal' File (Maybe String, Maybe Bytes)
- fileAttrs :: Traversal' File FileAttrs
- children :: Traversal' File (Map String File)
- child :: Traversal' File File
- descendant :: Fold' File File
- subEntry :: Traversal' DirEntry DirEntry
- anyEntry :: Fold' DirEntry DirEntry
- entryName :: Lens' DirEntry String
- entryFile :: Lens' DirEntry File
- named :: (String -> Bool) -> Traversal' DirEntry DirEntry
- withExtension :: String -> Traversal' DirEntry DirEntry
- fileName :: Lens' DirEntry String
- entry :: Lens' DirEntry File
- text :: Traversal' File String
- bytes :: Traversal' File Bytes
Exported modules and functions
module System.FilePath
module Definitive
creates a new directory
createDirectoryIfMissing
parents dirdir
if it doesn't exist. If the first argument is True
the function will also create all parent directories if they are missing.
The File interface
workingDirectory :: IO DirEntry Source #
The working directory, as a DirEntry
A useful monad for manipulating the filesystem as a state
The FS monad is a wrapper around the IO monad that provides a MonadState instance for interacting with the filesystem through the Filesystem type.
Thus, you may use lenses to access the representation of files as though they were variables, like so :
runFS $ (file "x.bmp".bytes.serial.from bmp) ^>= \r -> file "foo".bytes.serial.from jpg =- r
data Filesystem Source #
Status and PermMask
data FilePermissions Source #
runPermissionState :: FilePath -> State FilePermissions a -> IO a Source #
modifyPermissions :: FilePath -> (FilePermissions -> FilePermissions) -> IO () Source #