Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

File Input

Part of StandardLibraryCategory

Description

Demonstrates reading input from a text file.

Example

import std.stream;
import std.stdio;

int main(char[][] args)
{
    char[] fn = "file_io.html";    

    File f = new File(fn);
    while (!f.eof())
    {
        writefln("%s", f.readLine());
    }
    
    f.close();    

    return 0;
}

More Information

Find out more about std.stream in the D Specification.