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.

package
struct FS {}

Members

Static functions

copy
void copy(const(char)[] src, const(char)[] dst)

Transfer the content of another file to this one. Throws an IOException upon failure.

copy
void copy(const(char)[] source, const(char)[] dest)

Transfer the content of another file to this one. Returns a reference to this class on success, or throws an IOException upon failure.

createFile
void createFile(const(char)[] name)

Create a new file.

createFile
void createFile(const(char)[] name)

Create a new file.

createFolder
void createFolder(const(char)[] name)

Create a new directory.

createFolder
void createFolder(const(char)[] name)

Create a new directory.

exception
void exception(const(char)[] filename)

Throw an exception using the last known error.

exception
void exception(const(char)[] prefix, const(char)[] error)

Throw an IO exception.

exists
bool exists(const(char)[] name)

Return whether the file or path exists.

exists
bool exists(const(char)[] name)

Return whether the file or path exists.

fileSize
ulong fileSize(const(char)[] name)

Return the file length (in bytes.)

fileSize
ulong fileSize(const(char)[] name)

Return the file length (in bytes.)

isFile
bool isFile(const(char)[] name)

Is this a normal file?

isFile
bool isFile(const(char)[] name)

Is this a normal file?

isFolder
bool isFolder(const(char)[] name)

Is this file actually a folder/directory?

isFolder
bool isFolder(const(char)[] name)

Is this file actually a folder/directory?

isWritable
bool isWritable(const(char)[] name)

Is this file writable?

isWritable
bool isWritable(const(char)[] name)

Is this file writable?

join
char[] 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(const(char)[] folder, int delegate(ref FileInfo) dg, bool all)

List the set of filenames within this folder.

list
int list(const(char)[] folder, int delegate(ref FileInfo) dg, bool all)

List the set of filenames within this folder.

padded
inout(char)[] padded(inout(char)[] path, char c)

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

paddedLeading
inout(char)[] paddedLeading(inout(char)[] path, char c)

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

remove
bool remove(const(char)[] name)

Remove the file/directory from the file-system. Returns true on success - false otherwise.

remove
bool remove(const(char)[] name)

Remove the file/directory from the file-system. Returns true on success - false otherwise.

rename
void rename(const(char)[] src, const(char)[] dst)

Change the name or location of a file/directory.

rename
void rename(const(char)[] src, const(char)[] dst)

Change the name or location of a file/directory.

stripped
inout(char)[] stripped(inout(char)[] path, char c)

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

strz
char[] strz(const(char)[] src, char[] dst)

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

timeStamps
Stamps timeStamps(const(char)[] name)

Return timestamp information.

timeStamps
void timeStamps(const(char)[] name, Time accessed, Time modified)

Set the accessed and modified timestamps of the specified file.

timeStamps
Stamps timeStamps(const(char)[] name)

Return timestamp information.

timeStamps
void timeStamps(const(char)[] 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