Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GFileOutputStream provides output streams that write their content to a file.
GFileOutputStream implements Seekable
, which allows the output
stream to jump to arbitrary positions in the file and to truncate
the file, provided the filesystem of the file supports these
operations.
To find the position of a file output stream, use seekableTell
.
To find out if a file output stream supports seeking, use
seekableCanSeek
.To position a file output stream, use
seekableSeek
. To find out if a file output stream supports
truncating, use seekableCanTruncate
. To truncate a file output
stream, use seekableTruncate
.
- newtype FileOutputStream = FileOutputStream (ManagedPtr FileOutputStream)
- class GObject o => IsFileOutputStream o
- toFileOutputStream :: IsFileOutputStream o => o -> IO FileOutputStream
- noFileOutputStream :: Maybe FileOutputStream
- data FileOutputStreamGetEtagMethodInfo
- fileOutputStreamGetEtag :: (HasCallStack, MonadIO m, IsFileOutputStream a) => a -> m Text
- data FileOutputStreamQueryInfoMethodInfo
- fileOutputStreamQueryInfo :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) => a -> Text -> Maybe b -> m FileInfo
- data FileOutputStreamQueryInfoAsyncMethodInfo
- fileOutputStreamQueryInfoAsync :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) => a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data FileOutputStreamQueryInfoFinishMethodInfo
- fileOutputStreamQueryInfoFinish :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsAsyncResult b) => a -> b -> m FileInfo
Exported types
newtype FileOutputStream Source #
GObject FileOutputStream Source # | |
IsObject FileOutputStream Source # | |
IsOutputStream FileOutputStream Source # | |
IsFileOutputStream FileOutputStream Source # | |
IsSeekable FileOutputStream Source # | |
((~) * info (ResolveFileOutputStreamMethod t FileOutputStream), MethodInfo * info FileOutputStream p) => IsLabel t (FileOutputStream -> p) Source # | |
((~) * info (ResolveFileOutputStreamMethod t FileOutputStream), MethodInfo * info FileOutputStream p) => IsLabelProxy t (FileOutputStream -> p) Source # | |
HasAttributeList * FileOutputStream Source # | |
type AttributeList FileOutputStream Source # | |
type SignalList FileOutputStream Source # | |
class GObject o => IsFileOutputStream o Source #
toFileOutputStream :: IsFileOutputStream o => o -> IO FileOutputStream Source #
Methods
getEtag
data FileOutputStreamGetEtagMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsFileOutputStream a) => MethodInfo * FileOutputStreamGetEtagMethodInfo a signature Source # | |
fileOutputStreamGetEtag Source #
:: (HasCallStack, MonadIO m, IsFileOutputStream a) | |
=> a |
|
-> m Text | Returns: the entity tag for the stream. |
Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing.
queryInfo
data FileOutputStreamQueryInfoMethodInfo Source #
((~) * signature (Text -> Maybe b -> m FileInfo), MonadIO m, IsFileOutputStream a, IsCancellable b) => MethodInfo * FileOutputStreamQueryInfoMethodInfo a signature Source # | |
fileOutputStreamQueryInfo Source #
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> m FileInfo | Returns: a |
Queries a file output stream for the given attributes
.
This function blocks while querying the stream. For the asynchronous
version of this function, see fileOutputStreamQueryInfoAsync
.
While the stream is blocked, the stream will set the pending flag
internally, and any other operations on the stream will fail with
IOErrorEnumPending
.
Can fail if the stream was already closed (with error
being set to
IOErrorEnumClosed
), the stream has pending operations (with error
being
set to IOErrorEnumPending
), or if querying info is not supported for
the stream's interface (with error
being set to IOErrorEnumNotSupported
). In
all cases of failure, Nothing
will be returned.
If cancellable
is not Nothing
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnumCancelled
will be set, and Nothing
will
be returned.
queryInfoAsync
data FileOutputStreamQueryInfoAsyncMethodInfo Source #
((~) * signature (Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsFileOutputStream a, IsCancellable b) => MethodInfo * FileOutputStreamQueryInfoAsyncMethodInfo a signature Source # | |
fileOutputStreamQueryInfoAsync Source #
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously queries the stream
for a FileInfo
. When completed,
callback
will be called with a AsyncResult
which can be used to
finish the operation with fileOutputStreamQueryInfoFinish
.
For the synchronous version of this function, see
fileOutputStreamQueryInfo
.
queryInfoFinish
data FileOutputStreamQueryInfoFinishMethodInfo Source #
((~) * signature (b -> m FileInfo), MonadIO m, IsFileOutputStream a, IsAsyncResult b) => MethodInfo * FileOutputStreamQueryInfoFinishMethodInfo a signature Source # | |
fileOutputStreamQueryInfoFinish Source #
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m FileInfo | Returns: A |
Finalizes the asynchronous query started
by fileOutputStreamQueryInfoAsync
.