FileStream

A file stream.

Constructors

this
this(string path, string mode)

Constructs a file stream.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

close
void close()

Closes the stream.

flush
bool flush()

Clears all buffers of the stream and causes data to be written to the underlying device.

read
ptrdiff_t read(ubyte[] buffer)

Reads bytes from the specified stream in to the specified buffer

seek
long seek(ptrdiff_t offset, SeekOrigin origin)

Sets the reading position within the stream

write
ptrdiff_t write(ubyte[] buffer)

Writes bytes from the specified buffer in to the stream

Properties

canFlush
bool canFlush [@property getter]

Whether the stream can be flushed to disk.

canRead
bool canRead [@property getter]

Whether the stream can be read from.

canSeek
bool canSeek [@property getter]

Whether the stream can be seeked.

canTimeout
bool canTimeout [@property getter]

Whether the stream can timeout during operations.

canWrite
bool canWrite [@property getter]

Whether the stream can be written to.

length
ptrdiff_t length [@property getter]

Length of the stream.

readTimeout
int readTimeout [@property getter]

Timeout in milliseconds before a read operation will fail.

tell
ptrdiff_t tell [@property getter]

Position in stream

writeTimeout
int writeTimeout [@property getter]

Timeout in milliseconds before a write operation will fail.

Inherited Members

From Stream

canRead
bool canRead [@property getter]

Whether the stream can be read from.

canWrite
bool canWrite [@property getter]

Whether the stream can be written to.

canSeek
bool canSeek [@property getter]

Whether the stream can be seeked.

canTimeout
bool canTimeout [@property getter]

Whether the stream can timeout during operations.

canFlush
bool canFlush [@property getter]

Whether the stream can be flushed to disk.

length
ptrdiff_t length [@property getter]

Length of the stream.

tell
ptrdiff_t tell [@property getter]

Position in stream

readTimeout
int readTimeout [@property getter]

Timeout in milliseconds before a read operation will fail.

writeTimeout
int writeTimeout [@property getter]

Timeout in milliseconds before a write operation will fail.

flush
bool flush()

Clears all buffers of the stream and causes data to be written to the underlying device.

seek
long seek(ptrdiff_t offset, SeekOrigin origin)

Sets the reading position within the stream

close
void close()

Closes the stream.

read
ptrdiff_t read(ubyte[] buffer)

Reads bytes from the specified stream in to the specified buffer

write
ptrdiff_t write(ubyte[] buffer)

Writes bytes from the specified buffer in to the stream

Meta