hpath-0.8.0: Support for well-typed paths

Copyright© 2016 Julian Ospald
LicenseBSD3
MaintainerJulian Ospald <hasufell@posteo.de>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

System.Posix.FD

Description

Provides an alternative for openFd which gives us more control on what status flags to pass to the low-level open(2) call, in contrast to the unix package.

Synopsis

Documentation

openFd Source #

Arguments

:: RawFilePath 
-> OpenMode 
-> [Flags]

status flags of open(2)

-> Maybe FileMode

Just x => creates the file with the given modes, Nothing => the file must exist.

-> IO Fd 

Open and optionally create this file. See Files for information on how to use the FileMode type.

Note that passing Just x as the 4th argument triggers the oCreat status flag, which must be set when you pass in oExcl to the status flags. Also see the manpage for open(2).