std.stdio

Standard I/O functions that extend $(B std.c.stdio).  $(B std.c.stdio)
is $(D_PARAM public)ally imported when importing $(B std.stdio).

Source: $(PHOBOSSRC std/_stdio.d)
Macros:
WIKI=Phobos/StdStdio

Copyright: Copyright Digital Mars 2007-.
License:   $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors:   $(WEB digitalmars.com, Walter Bright),
           $(WEB erdani.org, Andrei Alexandrescu),
           Alex Rønne Petersen
 
  • fileno

  • fopen64

  • fputc_unlocked

  • fputwc_unlocked

  • fgetc_unlocked

  • fgetwc_unlocked

  • flockfile

  • funlockfile

  • getline

  • getdelim

  • FPUTC

  • FPUTWC

  • FGETC

  • FGETWC

  • FLOCK

  • FUNLOCK

  • ByRecord(Fields...)

  • byRecord(Fields...)

  • File

    Encapsulates a $(D FILE*). Generally D does not attempt to provide thin wrappers over equivalent functions in the C standard library, but manipulating $(D FILE*) values directly is unsafe and error-prone in many ways. The $(D File) type ensures safe manipulation, automatic file closing, and a lot of convenience.

  • LockingTextReader

  • isFileHandle(T)

    Indicates whether $(D T) is a file handle of some kind.

  • isStreamingDevice

    $(RED Scheduled for deprecation in January 2013. Please use $(D isFileHandle) instead.)

  • write(T...) if (!is(T[0] : File))

    For each argument $(D arg) in $(D args), format the argument (as per $(LINK2 std_conv.html, to!(string)(arg))) and write the resulting string to $(D args[0]). A call without any arguments will fail to compile.

  • writeln(T...)

    Equivalent to $(D write(args, '\n')). Calling $(D writeln) without arguments is valid and just prints a newline to the standard output.

  • writef(T...)

    If the first argument $(D args[0]) is a $(D FILE*), use $(LINK2 std_format.html#format-string, the format specifier) in $(D args[1]) to control the formatting of $(D args[2..$]), and write the resulting string to $(D args[0]). If $(D arg[0]) is not a $(D FILE*), the call is equivalent to $(D writef(stdout, args)).

  • writefln(T...)

    Equivalent to $(D writef(args, '\n')).

  • readf(A...)

    Read data from $(D stdin) according to the specified $(LINK2 std_format.html#format-string, format specifier) using $(XREF format,formattedRead).

  • readln

    Read line from stream $(D fp). Returns: $(D null) for end of file, $(D char[]) for line read from $(D fp), including terminating character Params: $(D fp) = input stream $(D terminator) = line terminator, '\n' by default Throws: $(D StdioException) on error Example: Reads $(D stdin) and writes it to $(D stdout). --- import std.stdio;

  • readln

    Read line from stream $(D fp). Returns: $(D null) for end of file, $(D char[]) for line read from $(D fp), including terminating character Params: $(D fp) = input stream $(D terminator) = line terminator, '\n' by default Throws: $(D StdioException) on error Example: Reads $(D stdin) and writes it to $(D stdout). --- import std.stdio;

  • popen

  • popen

    Convenience function that forwards to $(D std.c.stdio.popen) with appropriately-constructed C-style strings.

  • binaryWrite(T)

  • lines

    Iterates through the lines of a file by using $(D foreach).

  • chunks

    Iterates through a file a chunk at a time by using $(D foreach).

  • StdioException

    Thrown if I/O errors happen.

  • std_stdio_static_this

  • stdin

    The standard input stream.

  • stdout

    The standard output stream.

  • stderr

    The standard error stream.

  • openNetwork

    Experimental network access via the File interface