Module std.stdio
Standard I/O functions that extend core.stdc.stdio
. core.stdc.stdio
is public ally imported when importing std.stdio
.
Functions
Name
Description
chunks
Iterates through a file a chunk at a time by using foreach
.
openNetwork
Experimental network access via the File
interface
popen
Convenience function that forwards to core.sys.posix.stdio.popen
with appropriately-constructed C-style strings.
readf
Read data from stdin
according to the specified
format
specifier using
std.format.formattedRead.
readln
Read line from stdin
.
readln
Read line from stdin
and write
it to buf
[], including terminating character.
write
For each argument arg
in args
, format the argument (as per
to!(string)(arg) ) and write
the resulting
string to args
[0]
. A call without any arguments will fail to
compile.
writef
Writes formatted data to standard output (without a trailing newline).
writefln
Equivalent to writef
(args
, '\n')
.
writeln
Equivalent to write
(args
, '\n')
. Calling writeln
without
arguments is valid and just prints a newline to the standard
output.
Structs
Name
Description
File
Encapsulates a FILE*
. Generally D does not attempt to provide
thin wrappers over equivalent functions in the C standard library, but
manipulating FILE*
values directly is unsafe and error
-prone in
many ways. The File
type ensures safe manipulation, automatic
file closing, and a lot of convenience.
lines
Iterates through the lines
of a file by using foreach
.
Enum values
Name
Type
Description
isFileHandle
Indicates whether T
is a file handle of some kind.
Aliases
Name
Type
Description
isStreamingDevice
Deprecated. Please use isFileHandle
instead. This alias will be
removed in June 2015.
KeepTerminator
Flag !("keepTerminator")
If flag KeepTerminator
is set to KeepTerminator.yes
, then the delimiter
is included in the strings returned.
Comments
Please enable JavaScript to view the comments.