head function

Future<Stream<String>> head(
  1. String path,
  2. int lines
)

Returns count lines from the file at path.

head('/var/log/syslog', 10).forEach((line) => print(line));

Throws a HeadException exception if path is not a file.

Implementation

Future<Stream<String>> head(String path, int lines) async =>
    _Head().head(path, lines);