←back to thread

422 points km | 1 comments | | HN request time: 0s | source
Show context
perching_aix ◴[] No.41831129[source]
Well, at least the title is honest. Straight up asking people to break standards out of sheer conviction is a new one for me personally, but it's definitely one of the attitudes of all time, so maybe it's just me being green.

Can we ask for the typical *nix text editors to disobey the POSIX standard of a text file next, so that I don't need to use hex editing to get trailing newlines off the end of files?

replies(4): >>41831233 #>>41831275 #>>41831592 #>>41833146 #
201984 ◴[] No.41831233[source]
What's wrong with trailing newlines?
replies(2): >>41831241 #>>41831375 #
norir ◴[] No.41831375[source]
It makes writing parsers more complicated in certain cases because you can't tell without lookahead if a newline character should be treated as a newline or an eof.
replies(1): >>41831718 #
viraptor ◴[] No.41831718[source]
What? Which crazy non-binary format makes a distinction between CRLF(EOF) and just (EOF)? Apart from a plain text file, that is.
replies(1): >>41832157 #
nunobrito ◴[] No.41832157[source]
I won't mention telnet because you don't use it, but in CSV and similar data it is quite a trouble to normalize the data. So instead of 2 possibilities now we 3 to detect.
replies(2): >>41832526 #>>41832567 #
1. viraptor ◴[] No.41832567[source]
I don't get the CSV part. You can emit a new row after a line ending and on EOF with non-empty buffer. What's the tricky part or third option here? The crlf is never a part of the data.