FS

Wraps the O/S specific calls with a D API. Note that these accept null-terminated strings only, which is why it's not public. We need this declared first to avoid forward-reference issues.

Members

Static functions

copy
void copy(cstring source, mstring dest)

Transfer the content of another file to this one.

createFile
void createFile(cstring name, mode_t mode)

Create a new file.

createFolder
void createFolder(cstring name, mode_t mode)

Create a new directory.

exception
void exception(cstring filename)

Throw an exception using the last known error.

exception
void exception(cstring prefix, cstring error)

Throw an IO exception.

exists
bool exists(cstring name)
fileSize
ulong fileSize(cstring name)
isFile
bool isFile(cstring name)

Is this a normal file?

isFolder
bool isFolder(cstring name)

Is this file actually a folder/directory?

isReadable
bool isReadable(cstring name)
isWritable
bool isWritable(cstring name)

Is this file writable?

join
mstring join(const(char[])[] paths)

Join a set of path specs together. A path separator is potentially inserted between each of the segments.

list
int list(cstring folder, int delegate(ref FileInfo) dg, bool all)

List the set of filenames within this folder.

padded
cstring padded(cstring path, char c)

Return an adjusted path such that non-empty instances always have a trailing separator.

paddedLeading
cstring paddedLeading(cstring path, char c)

Return an adjusted path such that non-empty instances always have a leading separator.

remove
bool remove(cstring name)

Remove the file/directory from the file-system.

rename
void rename(cstring src, cstring dst)

Change the name or location of a file/directory.

stripped
cstring stripped(cstring path, char c)

Return an adjusted path such that non-empty instances do not have a trailing separator.

strz
mstring strz(cstring src, mstring dst)

Append a terminating null onto a string, cheaply where feasible.

timeStamps
Stamps timeStamps(cstring name)

Return timestamp information.

timeStamps
void timeStamps(cstring name, Time accessed, Time modified)

Set the accessed and modified timestamps of the specified file.

Structs

Listing
struct Listing

Some fruct glue for directory listings.

Stamps
struct Stamps

TimeStamp information. Accurate to whatever the F/S supports.

Meta