BufferedDirectReadFile.DirectReadFile

File to do direct IO reads.

Actually there is no way to open files with File specifying custom flags that is not sub-classing. Bummer!

class BufferedDirectReadFile
protected static
class DirectReadFile : File {}

Members

Functions

open
void open(cstring path, Style style)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From File

O_CLOEXEC
auto O_CLOEXEC;
Undocumented in source.
read
alias read = Device.read
Undocumented in source.
write
alias write = Device.write
Undocumented in source.
IOException
class IOException

Exception class thrown on errors.

Style
struct Style

Fits into 32 bits ...

Access
enum Access
Open
enum Open
Share
enum Share
Cache
enum Cache
ReadExisting
Style ReadExisting;

Read an existing file.

ReadShared
Style ReadShared;

Read an existing file.

WriteExisting
Style WriteExisting;

Write on an existing file. Do not create.

WriteCreate
Style WriteCreate;

Write on a clean file. Create if necessary.

ReadWriteAppending
Style ReadWriteAppending;

Read from the beginning, append at the end of the file.

WriteAppending
Style WriteAppending;

Write at the end of the file.

ReadWriteExisting
Style ReadWriteExisting;

Read and write an existing file.

ReadWriteCreate
Style ReadWriteCreate;

Read & write on a clean file. Create if necessary.

ReadWriteOpen
Style ReadWriteOpen;

Read and Write. Use existing file if present.

style
Style style()

Return the Style used for this file.

toString
istring toString()

Return the path used by this file.

path
cstring path()
get
void[] get(cstring path)

Convenience function to return the content of a file.

get
void[] get(cstring path, void[] dst)

Convenience function to return the content of a file.

set
void set(cstring path, const(void)[] content)

Convenience function to set file content and length to reflect the given array.

append
void append(cstring path, const(void)[] content)

Convenience function to append content to a file.

open
bool open(cstring path, Style style, int addflags, int access)

Low level open for sub-classes that need to apply specific attributes.

open
void open(cstring path, Style style)

Open a file with the provided style.

setFileHandle
void setFileHandle(int fd)

Wraps the already open file descriptor into a File instance.

truncate
void truncate()

Set the file size to be that of the current seek position. The file must be writable for this to succeed.

truncate
void truncate(long size)

Set the file size to be the specified length. The file must be writable for this to succeed.

seek
long seek(long offset, Anchor anchor)

Set the file seek position to the specified offset from the given anchor.

position
long position()

Return the current file position.

length
long length()

Return the total length of this file.

sync
void sync()

Instructs the OS to flush it's internal buffers to the disk device.

error
void error(int error_code, istring func_name, istring msg, istring file, long line)

Throw a potentially reusable IOException, with the provided message, function name and error code.

error
alias error = Conduit.error

Throw an IOException, with the provided message.

error
alias error = Device.error

Throw an IOException noting the last error.

Meta