Safe Haskell | None |
---|---|
Language | Haskell2010 |
Streamly.Internal.FileSystem.Posix.File
Synopsis
- newtype OpenFlags = OpenFlags CInt
- defaultOpenFlags :: OpenFlags
- setAppend :: Bool -> OpenFlags -> OpenFlags
- setNonBlock :: Bool -> OpenFlags -> OpenFlags
- setSync :: Bool -> OpenFlags -> OpenFlags
- setCloExec :: Bool -> OpenFlags -> OpenFlags
- setDirectory :: Bool -> OpenFlags -> OpenFlags
- setExcl :: Bool -> OpenFlags -> OpenFlags
- setNoCtty :: Bool -> OpenFlags -> OpenFlags
- setNoFollow :: Bool -> OpenFlags -> OpenFlags
- setTrunc :: Bool -> OpenFlags -> OpenFlags
- defaultCreateMode :: FileMode
- setUr :: FileMode -> FileMode
- setUw :: FileMode -> FileMode
- setUx :: FileMode -> FileMode
- clrUr :: FileMode -> FileMode
- clrUw :: FileMode -> FileMode
- clrUx :: FileMode -> FileMode
- setGr :: FileMode -> FileMode
- setGw :: FileMode -> FileMode
- setGx :: FileMode -> FileMode
- clrGr :: FileMode -> FileMode
- clrGw :: FileMode -> FileMode
- clrGx :: FileMode -> FileMode
- setOr :: FileMode -> FileMode
- setOw :: FileMode -> FileMode
- setOx :: FileMode -> FileMode
- clrOr :: FileMode -> FileMode
- clrOw :: FileMode -> FileMode
- clrOx :: FileMode -> FileMode
- setSuid :: FileMode -> FileMode
- setSgid :: FileMode -> FileMode
- setSticky :: FileMode -> FileMode
- clrSuid :: FileMode -> FileMode
- clrSgid :: FileMode -> FileMode
- clrSticky :: FileMode -> FileMode
- openAt :: Maybe Fd -> PosixPath -> OpenFlags -> Maybe FileMode -> IO Fd
- close :: Fd -> IO ()
- openFile :: PosixPath -> IOMode -> IO Handle
- withFile :: PosixPath -> IOMode -> (Handle -> IO r) -> IO r
- openBinaryFile :: PosixPath -> IOMode -> IO Handle
- withBinaryFile :: PosixPath -> IOMode -> (Handle -> IO r) -> IO r
- data Fd
File open flags
Open flags, see posix open system call man page.
defaultOpenFlags :: OpenFlags Source #
Default values for the OpenFlags
.
By default a 0 value is used, no flag is set. See the open system call man page.
File status flags
File creation flags
File create mode
defaultCreateMode :: FileMode Source #
User Permissions
Group Permissions
Other Permissions
Status bits
Fd based Low Level
Arguments
:: Maybe Fd | Optional directory file descriptor |
-> PosixPath | Pathname to open |
-> OpenFlags | Append, exclusive, truncate, etc. |
-> Maybe FileMode | Create mode |
-> IO Fd |
Open a file relative to an optional directory file descriptor.
Note: In Haskell, using an fd directly for IO may be problematic as blocking file system operations on the file might block the capability and GC for "unsafe" calls. "safe" calls may be more expensive. Also, you may have to synchronize concurrent access via multiple threads.
Handle based
openFile :: PosixPath -> IOMode -> IO Handle Source #
Like openFile in base package but using Path instead of FilePath. Use hSetBinaryMode on the handle if you want to use binary mode.
withFile :: PosixPath -> IOMode -> (Handle -> IO r) -> IO r Source #
Like withFile in base package but using Path instead of FilePath. Use hSetBinaryMode on the handle if you want to use binary mode.
openBinaryFile :: PosixPath -> IOMode -> IO Handle Source #
Like openBinaryFile in base package but using Path instead of FilePath.
withBinaryFile :: PosixPath -> IOMode -> (Handle -> IO r) -> IO r Source #
Like withBinaryFile in base package but using Path instead of FilePath.
Instances
Storable Fd | |
Defined in System.Posix.Types | |
Bits Fd | |
Defined in System.Posix.Types | |
FiniteBits Fd | |
Defined in System.Posix.Types Methods finiteBitSize :: Fd -> Int # countLeadingZeros :: Fd -> Int # countTrailingZeros :: Fd -> Int # | |
Bounded Fd | |
Enum Fd | |
Ix Fd | |
Num Fd | |
Read Fd | |
Integral Fd | |
Real Fd | |
Defined in System.Posix.Types Methods toRational :: Fd -> Rational # | |
Show Fd | |
Eq Fd | |
Ord Fd | |