How can I easily determine the last charachter of a file?

Steven Schveighoffer schveiguy at gmail.com
Wed Feb 15 02:03:19 UTC 2023


```d
myFile.seek(-1, SEEK_END);
ubyte c[1];
myFile.rawRead(c[]);
if(c[0] == '\n') // ends in newline
```

-Steve


More information about the Digitalmars-d-learn mailing list