On Tuesday, 14 February 2023 at 18:30:05 UTC, seany wrote:
Hello
Consider the content of a file
First line \n
Second line
data data data data ... last char
My goal is to find out whether the last character is a new line
or not. Please not, it will be sufficient if this w
```d
myFile.seek(-1, SEEK_END);
ubyte c[1];
myFile.rawRead(c[]);
if(c[0] == '\n') // ends in newline
```
-Steve
Hello
Consider the content of a file
First line \n
Second line
data data data data ... last char
My goal is to find out whether the last character is a new line
or not. Please not, it will be sufficient if this works on Linux.
More specifically I want to insert a new li