File.lockingTextWriter

Output range which locks the file when created, and unlocks the file when it goes out of scope.

struct File
@safe
lockingTextWriter
()

Return Value

Type: auto

An output range which accepts string types, ubyte[], individual character types, and individual ubytes.

Note: Writing either arrays of chars or ubytes is faster than writing each character individually from a range. For large amounts of data, writing the contents in chunks using an intermediary array can result in a speed increase.

Throws

std.utf.UTFException if the data given is a char range and it contains malformed UTF data.

See Also

byChunk for an example.

Meta