Elektrine lite

← Feed

@kimapr@ublog.kimapr.net

Post #2535059

2026-01-08 01:01 UTC

@rose @nblr@chaos.social probably the programs take a simplistic approach to reading text files because the posix spec allows them to. if you go by the posix definition of “text file” and “line”, a file that doesn’t have an end-of-line character at the end isn’t a text file at all, and the last “line” of it isn’t an actual line because it doesn’t end in an end-of-line character, so posix programs that deal in “text files” are allowed to malfunction when encountering such things

Replies (1)

  • @kimapr@ublog.kimapr.net Indeed. It comes down to how software read files. ASCII characters are just binary values stored in a file. Files do not have lines. A line end is a specific control character. When reading a line from a file one will look for the next occurrence of a line end character. Hence the last line should end in one. Technically there is no such thing as a line end. We know the line feed character and to make things more complicated it can be preceded by a carriage return character. @nblr@chaos.social @rose

    Open ##2535060