The following code behaves differently on OSX than LINUX (DMD 1.040):

import std.stdio;
import std.file;

int Lines(Stream f)
  int ln = 0;

  foreach (char[] line; f) ln++;
  return ln;

void main(char[][] args)
  auto f = new BufferedFile(args[1]);
  int l = Lines(f);, SeekPos.Set);
  int r = Lines(f);
  fwritef(stderr, "Lines before: %d, Lines after: %d\n", l, r);

Results for OSX:
Lines before: 1633, Lines after: 0

Results for LINUX
Lines before: 1633, Lines after: 1633

Seek not working properly perhaps?


Reply via email to