www.digitalmars.com         C & C++   DMDScript  

D - Error: not enough data in stream

The following code terminates with the above error prior to reading the last
word from the file regardless of filesize.
import stream;

int main()
  char[] str;
  File file = new File("words.dat");

    file.scanf("%.*s", &str);
    printf("%.*s\n", str);
  return 0;

Nov 27 2002