Portability | portable (depends on GHC) |
---|---|
Stability | alpha |
Maintainer | gtk2hs-devel@lists.sourceforge.net |
- data Handle
- data Result
- = Ok
- | ErrorNotFound
- | ErrorGeneric
- | ErrorInternal
- | ErrorBadParameters
- | ErrorNotSupported
- | ErrorIo
- | ErrorCorruptedData
- | ErrorWrongFormat
- | ErrorBadFile
- | ErrorTooBig
- | ErrorNoSpace
- | ErrorReadOnly
- | ErrorInvalidUri
- | ErrorNotOpen
- | ErrorInvalidOpenMode
- | ErrorAccessDenied
- | ErrorTooManyOpenFiles
- | ErrorEof
- | ErrorNotADirectory
- | ErrorInProgress
- | ErrorInterrupted
- | ErrorFileExists
- | ErrorLoop
- | ErrorNotPermitted
- | ErrorIsDirectory
- | ErrorNoMemory
- | ErrorHostNotFound
- | ErrorInvalidHostName
- | ErrorHostHasNoAddress
- | ErrorLoginFailed
- | ErrorCancelled
- | ErrorDirectoryBusy
- | ErrorDirectoryNotEmpty
- | ErrorTooManyLinks
- | ErrorReadOnlyFileSystem
- | ErrorNotSameFileSystem
- | ErrorNameTooLong
- | ErrorServiceNotAvailable
- | ErrorServiceObsolete
- | ErrorProtocolError
- | ErrorNoMasterBrowser
- | ErrorNoDefault
- | ErrorNoHandler
- | ErrorParse
- | ErrorLaunch
- | ErrorTimeout
- | ErrorNameserver
- | ErrorLocked
- | ErrorDeprecatedFunction
- | ErrorInvalidFilename
- | ErrorNotASymbolicLink
- | NumErrors
- data OpenMode
- = OpenNone
- | OpenRead
- | OpenWrite
- | OpenRandom
- | OpenTruncate
- data SeekPosition
- = SeekStart
- | SeekCurrent
- | SeekEnd
- data FilePermissions
- type FileSize = Word64
- type FileOffset = Word64
- open :: TextURI -> OpenMode -> IO Handle
- openURI :: URI -> OpenMode -> IO Handle
- create :: TextURI -> OpenMode -> Bool -> [FilePermissions] -> IO Handle
- createURI :: URI -> OpenMode -> Bool -> [FilePermissions] -> IO Handle
- close :: Handle -> IO ()
- seek :: Handle -> SeekPosition -> FileOffset -> IO ()
- tell :: Handle -> IO FileSize
- forgetCache :: Handle -> FileOffset -> FileSize -> IO ()
- truncate :: String -> FileSize -> IO ()
- truncateURI :: URI -> FileSize -> IO ()
- truncateHandle :: Handle -> FileSize -> IO ()
- getFileInfo :: String -> [FileInfoOptions] -> IO FileInfo
- getFileInfoURI :: URI -> [FileInfoOptions] -> IO FileInfo
- getFileInfoFromHandle :: Handle -> [FileInfoOptions] -> IO FileInfo
- setFileInfo :: String -> FileInfo -> [SetFileInfoMask] -> IO ()
- setFileInfoURI :: URI -> FileInfo -> [SetFileInfoMask] -> IO ()
Types
The result of a file operation.
data SeekPosition Source
Specifies the start position for a seek operation.
data FilePermissions Source
UNIX-like permissions for a file.
type FileOffset = Word64Source
An integral type wide enough to hold an offset into a file.
I/O Operations
Open the file at textURI
.
Open the file at uri
.
:: TextURI |
|
-> OpenMode |
|
-> Bool |
|
-> [FilePermissions] |
|
-> IO Handle | a handle to the created file |
Create a file at textURI
.
:: URI |
|
-> OpenMode |
|
-> Bool |
|
-> [FilePermissions] |
|
-> IO Handle | a handle to the created file |
Create a file at uri
.
:: Handle |
|
-> SeekPosition |
|
-> FileOffset |
|
-> IO () |
Seek to a position in a file.
Return the current position in the file.
forgetCache :: Handle -> FileOffset -> FileSize -> IO ()Source
Free any cache associated with the file opened on handle
,
in the region of size
bytes starting at offset
.
Truncation
truncateHandle :: Handle -> FileSize -> IO ()Source
Truncate the file opened on handle
to length
bytes.
File Information
getFileInfo :: String -> [FileInfoOptions] -> IO FileInfoSource
Get the file information for the file at textURI
.
getFileInfoURI :: URI -> [FileInfoOptions] -> IO FileInfoSource
Get the file information for the file at uri
.
getFileInfoFromHandle :: Handle -> [FileInfoOptions] -> IO FileInfoSource
Get the file information for the file opened on handle
.