Array of characters read.
FileException if there is an error reading the file, std.utf.UTFException on UTF decoding error.
Read file with UTF-8 text.
write(deleteme, "abc"); // deleteme is the name of a temporary file scope(exit) remove(deleteme); string content = readText(deleteme); assert(content == "abc");
std.file.read for reading a binary file.
Reads and validates (using std.utf.validate) a text file. S can be an array of any character type. However, no width or endian conversions are performed. So, if the width or endianness of the characters in the given file differ from the width or endianness of the element type of S, then validation will fail.