tango.io.device.Device

License:

BSD style: see license.txt

Version:

May 2005: Initial release

Author:

Kris
class Device : Conduit, ISelectable
Implements a means of reading and writing a file device. Conduits are the primary means of accessing external data, and this one is used as a superclass for the console, for files, sockets etc.
alias Conduit.error error
expose superclass definition also
void error() [final]
Throw an IOException noting the last error.
immutable(char)[] toString() [override]
Return the name of this device.
size_t bufferSize() [override, const]
Return a preferred size for buffering conduit I/O.
void reopen(Handle handle) [protected]
Allow adjustment of standard IO handles.
Handle fileHandle() [@property, final]
Return the underlying OS handle of this Conduit.
void detach() [override]
Release the underlying file.
size_t read(void[] dst) [override]
Read a chunk of bytes from the file into the provided array. Returns the number of bytes read, or Eof where there is no further data.
size_t write(const(void)[] src) [override]
Write a chunk of bytes to the file from the provided array. Returns the number of bytes written, or Eof if the output is no longer available.