-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Basic file IO operations via 'OsPath'
--   
--   Basic file IO operations like Prelude, but for OsPath.
@package file-io
@version 0.1.5

module System.File.OsPath.Internal

-- | Like openFile, but open the file in binary mode. On Windows,
--   reading a file in text mode (which is the default) will translate CRLF
--   to LF, and writing will translate LF to CRLF. This is usually what you
--   want with text files. With binary files this is undesirable; also, as
--   usual under Microsoft operating systems, text mode treats control-Z as
--   EOF. Binary mode turns off all special treatment of end-of-line and
--   end-of-file characters. (See also hSetBinaryMode.)
openBinaryFile :: OsPath -> IOMode -> IO Handle

-- | Run an action on a file.
--   
--   The Handle is automatically closed afther the action.
withFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
withBinaryFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Run an action on a file.
--   
--   The Handle is not automatically closed to allow lazy IO. Use
--   this with caution.
withFile' :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
withBinaryFile' :: OsPath -> IOMode -> (Handle -> IO r) -> IO r

-- | The readFile function reads a file and returns the contents of
--   the file as a ByteString. The file is read lazily, on demand.
readFile :: OsPath -> IO ByteString

-- | The readFile' function reads a file and returns the contents of
--   the file as a ByteString. The file is fully read before being
--   returned.
readFile' :: OsPath -> IO ByteString

-- | The computation writeFile file str function writes the
--   lazy ByteString str, to the file file.
writeFile :: OsPath -> ByteString -> IO ()

-- | The computation writeFile file str function writes the
--   strict ByteString str, to the file file.
writeFile' :: OsPath -> ByteString -> IO ()

-- | The computation appendFile file str function appends
--   the lazy ByteString str, to the file file.
appendFile :: OsPath -> ByteString -> IO ()

-- | The computation appendFile file str function appends
--   the strict ByteString str, to the file
--   file.
appendFile' :: OsPath -> ByteString -> IO ()

-- | Open a file and return the Handle.
openFile :: OsPath -> IOMode -> IO Handle

-- | Open an existing file and return the Handle.
openExistingFile :: OsPath -> IOMode -> IO Handle

-- | Open a file and return the Handle.
--   
--   Sets O_CLOEXEC on posix.
openFileWithCloseOnExec :: OsPath -> IOMode -> IO Handle

-- | Open an existing file and return the Handle.
--   
--   Sets O_CLOEXEC on posix.
openExistingFileWithCloseOnExec :: OsPath -> IOMode -> IO Handle

-- | The function creates a temporary file in ReadWrite mode. The created
--   file isn't deleted automatically, so you need to delete it manually.
--   
--   The file is created with permissions such that only the current user
--   can read/write it.
--   
--   With some exceptions (see below), the file will be created securely in
--   the sense that an attacker should not be able to cause openTempFile to
--   overwrite another file on the filesystem using your credentials, by
--   putting symbolic links (on Unix) in the place where the temporary file
--   is to be created. On Unix the O_CREAT and O_EXCL
--   flags are used to prevent this attack, but note that O_EXCL
--   is sometimes not supported on NFS filesystems, so if you rely on this
--   behaviour it is best to use local filesystems only.
openTempFile :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openTempFile, but opens the file in binary mode. See
--   openBinaryFile for more comments.
openBinaryTempFile :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openTempFile, but uses the default file permissions
openTempFileWithDefaultPermissions :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openBinaryTempFile, but uses the default file permissions
openBinaryTempFileWithDefaultPermissions :: OsPath -> OsString -> IO (OsPath, Handle)
handleFinalizer :: FilePath -> MVar Handle__ -> IO ()
type HandleFinalizer = FilePath -> MVar Handle__ -> IO ()

-- | Add a finalizer to a Handle. Specifically, the finalizer will
--   be added to the MVar of a file handle or the write-side
--   MVar of a duplex handle. See Handle Finalizers for details.
addHandleFinalizer :: Handle -> HandleFinalizer -> IO ()
withOpenFile' :: OsPath -> IOMode -> Bool -> Bool -> Bool -> (Handle -> IO r) -> Bool -> IO r
addFilePathToIOError :: String -> OsPath -> IOException -> IOException
augmentError :: String -> OsPath -> IO a -> IO a
openTempFile' :: String -> OsPath -> OsString -> Bool -> CMode -> IO (OsPath, Handle)
any_ :: (OsChar -> Bool) -> OsString -> Bool

-- | This module mimics base API wrt file IO, but using OsPath.
module System.File.OsPath

-- | Like openFile, but open the file in binary mode. On Windows,
--   reading a file in text mode (which is the default) will translate CRLF
--   to LF, and writing will translate LF to CRLF. This is usually what you
--   want with text files. With binary files this is undesirable; also, as
--   usual under Microsoft operating systems, text mode treats control-Z as
--   EOF. Binary mode turns off all special treatment of end-of-line and
--   end-of-file characters. (See also hSetBinaryMode.)
openBinaryFile :: OsPath -> IOMode -> IO Handle

-- | Run an action on a file.
--   
--   The Handle is automatically closed afther the action.
withFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
withBinaryFile :: OsPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Run an action on a file.
--   
--   The Handle is not automatically closed to allow lazy IO. Use
--   this with caution.
withFile' :: OsPath -> IOMode -> (Handle -> IO r) -> IO r
withBinaryFile' :: OsPath -> IOMode -> (Handle -> IO r) -> IO r

-- | The readFile function reads a file and returns the contents of
--   the file as a ByteString. The file is read lazily, on demand.
readFile :: OsPath -> IO ByteString

-- | The readFile' function reads a file and returns the contents of
--   the file as a ByteString. The file is fully read before being
--   returned.
readFile' :: OsPath -> IO ByteString

-- | The computation writeFile file str function writes the
--   lazy ByteString str, to the file file.
writeFile :: OsPath -> ByteString -> IO ()

-- | The computation writeFile file str function writes the
--   strict ByteString str, to the file file.
writeFile' :: OsPath -> ByteString -> IO ()

-- | The computation appendFile file str function appends
--   the lazy ByteString str, to the file file.
appendFile :: OsPath -> ByteString -> IO ()

-- | The computation appendFile file str function appends
--   the strict ByteString str, to the file
--   file.
appendFile' :: OsPath -> ByteString -> IO ()

-- | Open a file and return the Handle.
openFile :: OsPath -> IOMode -> IO Handle

-- | Open an existing file and return the Handle.
openExistingFile :: OsPath -> IOMode -> IO Handle

-- | The function creates a temporary file in ReadWrite mode. The created
--   file isn't deleted automatically, so you need to delete it manually.
--   
--   The file is created with permissions such that only the current user
--   can read/write it.
--   
--   With some exceptions (see below), the file will be created securely in
--   the sense that an attacker should not be able to cause openTempFile to
--   overwrite another file on the filesystem using your credentials, by
--   putting symbolic links (on Unix) in the place where the temporary file
--   is to be created. On Unix the O_CREAT and O_EXCL
--   flags are used to prevent this attack, but note that O_EXCL
--   is sometimes not supported on NFS filesystems, so if you rely on this
--   behaviour it is best to use local filesystems only.
openTempFile :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openTempFile, but opens the file in binary mode. See
--   openBinaryFile for more comments.
openBinaryTempFile :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openTempFile, but uses the default file permissions
openTempFileWithDefaultPermissions :: OsPath -> OsString -> IO (OsPath, Handle)

-- | Like openBinaryTempFile, but uses the default file permissions
openBinaryTempFileWithDefaultPermissions :: OsPath -> OsString -> IO (OsPath, Handle)

module System.File.PlatformPath.Internal

-- | Like openBinaryFile, but takes a PlatformPath instead of
--   an OsPath.
openBinaryFile :: PlatformPath -> IOMode -> IO Handle

-- | Like withFile, but takes a PlatformPath instead of an
--   OsPath.
withFile :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withBinaryFile, but takes a PlatformPath instead of
--   an OsPath.
withBinaryFile :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withFile', but takes a PlatformPath instead of an
--   OsPath.
withFile' :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withBinaryFile', but takes a PlatformPath instead
--   of an OsPath.
withBinaryFile' :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like readFile, but takes a PlatformPath instead of an
--   OsPath.
readFile :: PlatformPath -> IO ByteString

-- | Like readFile', but takes a PlatformPath instead of an
--   OsPath.
readFile' :: PlatformPath -> IO ByteString

-- | Like writeFile, but takes a PlatformPath instead of an
--   OsPath.
writeFile :: PlatformPath -> ByteString -> IO ()

-- | Like writeFile', but takes a PlatformPath instead of an
--   OsPath.
writeFile' :: PlatformPath -> ByteString -> IO ()

-- | Like appendFile, but takes a PlatformPath instead of an
--   OsPath.
appendFile :: PlatformPath -> ByteString -> IO ()

-- | Like appendFile', but takes a PlatformPath instead of an
--   OsPath.
appendFile' :: PlatformPath -> ByteString -> IO ()

-- | Like openFile, but takes a PlatformPath instead of an
--   OsPath.
openFile :: PlatformPath -> IOMode -> IO Handle

-- | Like openExistingFile, but takes a PlatformPath instead
--   of an OsPath.
openExistingFile :: PlatformPath -> IOMode -> IO Handle

-- | Open a file and return the Handle.
--   
--   Sets O_CLOEXEC on posix.
openFileWithCloseOnExec :: PlatformPath -> IOMode -> IO Handle

-- | Open an existing file and return the Handle.
--   
--   Sets O_CLOEXEC on posix.
openExistingFileWithCloseOnExec :: PlatformPath -> IOMode -> IO Handle
handleFinalizer :: FilePath -> MVar Handle__ -> IO ()
type HandleFinalizer = FilePath -> MVar Handle__ -> IO ()

-- | Add a finalizer to a Handle. Specifically, the finalizer will
--   be added to the MVar of a file handle or the write-side
--   MVar of a duplex handle. See Handle Finalizers for details.
addHandleFinalizer :: Handle -> HandleFinalizer -> IO ()
withOpenFile' :: PlatformPath -> IOMode -> Bool -> Bool -> Bool -> (Handle -> IO r) -> Bool -> IO r
addFilePathToIOError :: String -> PlatformPath -> IOException -> IOException
augmentError :: String -> PlatformPath -> IO a -> IO a

-- | This module is only interesting when you are implementing low-level
--   libraries based on OsPath API.
--   
--   Usually you want System.File.OsPath.
module System.File.PlatformPath

-- | Like openBinaryFile, but takes a PlatformPath instead of
--   an OsPath.
openBinaryFile :: PlatformPath -> IOMode -> IO Handle

-- | Like withFile, but takes a PlatformPath instead of an
--   OsPath.
withFile :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withBinaryFile, but takes a PlatformPath instead of
--   an OsPath.
withBinaryFile :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withFile', but takes a PlatformPath instead of an
--   OsPath.
withFile' :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like withBinaryFile', but takes a PlatformPath instead
--   of an OsPath.
withBinaryFile' :: PlatformPath -> IOMode -> (Handle -> IO r) -> IO r

-- | Like readFile, but takes a PlatformPath instead of an
--   OsPath.
readFile :: PlatformPath -> IO ByteString

-- | Like readFile', but takes a PlatformPath instead of an
--   OsPath.
readFile' :: PlatformPath -> IO ByteString

-- | Like writeFile, but takes a PlatformPath instead of an
--   OsPath.
writeFile :: PlatformPath -> ByteString -> IO ()

-- | Like writeFile', but takes a PlatformPath instead of an
--   OsPath.
writeFile' :: PlatformPath -> ByteString -> IO ()

-- | Like appendFile, but takes a PlatformPath instead of an
--   OsPath.
appendFile :: PlatformPath -> ByteString -> IO ()

-- | Like appendFile', but takes a PlatformPath instead of an
--   OsPath.
appendFile' :: PlatformPath -> ByteString -> IO ()

-- | Like openFile, but takes a PlatformPath instead of an
--   OsPath.
openFile :: PlatformPath -> IOMode -> IO Handle

-- | Like openExistingFile, but takes a PlatformPath instead
--   of an OsPath.
openExistingFile :: PlatformPath -> IOMode -> IO Handle
