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 |
UnixOutputStream
implements OutputStream
for writing to a UNIX
file descriptor, including asynchronous operations. (If the file
descriptor refers to a socket or pipe, this will use poll()
to do
asynchronous I/O. If it refers to a regular file, it will fall back
to doing asynchronous I/O in another thread.)
Note that <gio/gunixoutputstream.h>
belongs to the UNIX-specific GIO
interfaces, thus you have to use the gio-unix-2.0.pc
pkg-config file
when using it.
- newtype UnixOutputStream = UnixOutputStream (ManagedPtr UnixOutputStream)
- class GObject o => IsUnixOutputStream o
- toUnixOutputStream :: (MonadIO m, IsUnixOutputStream o) => o -> m UnixOutputStream
- noUnixOutputStream :: Maybe UnixOutputStream
- unixOutputStreamGetCloseFd :: (HasCallStack, MonadIO m, IsUnixOutputStream a) => a -> m Bool
- unixOutputStreamGetFd :: (HasCallStack, MonadIO m, IsUnixOutputStream a) => a -> m Int32
- unixOutputStreamNew :: (HasCallStack, MonadIO m) => Int32 -> Bool -> m UnixOutputStream
- unixOutputStreamSetCloseFd :: (HasCallStack, MonadIO m, IsUnixOutputStream a) => a -> Bool -> m ()
- constructUnixOutputStreamCloseFd :: IsUnixOutputStream o => Bool -> IO (GValueConstruct o)
- getUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Bool
- setUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> Bool -> m ()
- constructUnixOutputStreamFd :: IsUnixOutputStream o => Int32 -> IO (GValueConstruct o)
- getUnixOutputStreamFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Int32
Exported types
newtype UnixOutputStream Source #
class GObject o => IsUnixOutputStream o Source #
toUnixOutputStream :: (MonadIO m, IsUnixOutputStream o) => o -> m UnixOutputStream Source #
Methods
getCloseFd
unixOutputStreamGetCloseFd Source #
:: (HasCallStack, MonadIO m, IsUnixOutputStream a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the file descriptor of stream
will be
closed when the stream is closed.
Since: 2.20
getFd
unixOutputStreamGetFd Source #
:: (HasCallStack, MonadIO m, IsUnixOutputStream a) | |
=> a |
|
-> m Int32 | Returns: The file descriptor of |
Return the UNIX file descriptor that the stream writes to.
Since: 2.20
new
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Bool |
|
-> m UnixOutputStream | Returns: a new |
Creates a new UnixOutputStream
for the given fd
.
If closeFd
, is True
, the file descriptor will be closed when
the output stream is destroyed.
setCloseFd
unixOutputStreamSetCloseFd Source #
:: (HasCallStack, MonadIO m, IsUnixOutputStream a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the file descriptor of stream
shall be closed
when the stream is closed.
Since: 2.20
Properties
closeFd
constructUnixOutputStreamCloseFd :: IsUnixOutputStream o => Bool -> IO (GValueConstruct o) Source #
getUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Bool Source #
setUnixOutputStreamCloseFd :: (MonadIO m, IsUnixOutputStream o) => o -> Bool -> m () Source #
fd
constructUnixOutputStreamFd :: IsUnixOutputStream o => Int32 -> IO (GValueConstruct o) Source #
getUnixOutputStreamFd :: (MonadIO m, IsUnixOutputStream o) => o -> m Int32 Source #