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

std.stream readLine

Part of StandardLibraryCategory

Description

Read a file line-by-line.

Example

import std.c.stdio;
import std.stream;

int main (char [] [] args )
{
 File file = new File("testreadLine.d");
 char[] line;

 do
 {
  line = file.readLine();
  printf("Line: %.*s\n",line);
 }while(!file.eof);

 getch();
 return 1;
}

Source

Based on code from D.bugs:221.