Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data NarEffects (m :: Type -> Type) = NarEffects {
- narReadFile :: FilePath -> m ByteString
- narWriteFile :: FilePath -> IsExecutable -> ByteString -> m ()
- narStreamFile :: FilePath -> IsExecutable -> m (Maybe ByteString) -> m ()
- narListDir :: FilePath -> m [FilePath]
- narCreateDir :: FilePath -> m ()
- narCreateLink :: FilePath -> FilePath -> m ()
- narIsExec :: FilePath -> m IsExecutable
- narIsDir :: FilePath -> m Bool
- narIsSymLink :: FilePath -> m Bool
- narFileSize :: FilePath -> m Int64
- narReadLink :: FilePath -> m FilePath
- narDeleteDir :: FilePath -> m ()
- narDeleteFile :: FilePath -> m ()
- narEffectsIO :: (MonadIO m, MonadFail m, MonadBaseControl IO m) => NarEffects m
- data IsExecutable
- isExecutable :: FileStatus -> Bool
- setExecutable :: FilePath -> IO ()
Documentation
data NarEffects (m :: Type -> Type) Source #
NarEffects | |
|
narEffectsIO :: (MonadIO m, MonadFail m, MonadBaseControl IO m) => NarEffects m Source #
A particular NarEffects
that uses regular POSIX for file manipulation
You would replace this with your own NarEffects
if you wanted a
different backend
data IsExecutable Source #
Instances
Show IsExecutable Source # | |
Defined in System.Nix.Nar.Effects showsPrec :: Int -> IsExecutable -> ShowS # show :: IsExecutable -> String # showList :: [IsExecutable] -> ShowS # | |
Eq IsExecutable Source # | |
Defined in System.Nix.Nar.Effects (==) :: IsExecutable -> IsExecutable -> Bool # (/=) :: IsExecutable -> IsExecutable -> Bool # |
isExecutable :: FileStatus -> Bool Source #
Check whether the file is executable by the owner.
Matches the logic used by Nix.
access() should not be used for this purpose on macOS. It returns false for executables when placed in certain directories. For example, when in an app bundle: App.appContentsResourcesen.lprojmyexecutable.strings
setExecutable :: FilePath -> IO () Source #
Set the file to be executable by the owner, group, and others.
Matches the logic used by Nix.