Hacker News new | ask | show | jobs
by dataflow 1522 days ago
Linux even allows filenames with end-of-transmission characters in them, which is a choice I'd question long before I start questioning newlines!
1 comments

EOT or ctrl-D only has significance when typed into a tty. Once it has turned into a character it is as harmless as any other byte value, it doesn't end anything by itself.
Doesn't the article show that newline isn't harmless at all?

Of course EOT doesn't end anything by itself, nor does 0x0a end a line by itself -- all that happens through code that interprets those characters in a particular way, so talking about the "danger" of a character in absence of any code that operates on it is meaningless. In the presence of code, on the other hand, "harmless" in the extreme sense means "there exists no code that will act up when presented this character", which the article shows to be wrong.

I'm aware, but it nevertheless doesn't make any sense to have it in a file name.
I'm just saying that it makes exactly as much sense as ctrl-E or any other control char, it has no special status.
There are quite a few ASCII control characters [1] that could make more sense than EOT, e.g., \t, \n, \e, etc.

But yes, EOT is not the only nonsensical character that you could put in a file name, and I never claimed such.

[1] https://en.wikipedia.org/wiki/Control_character#In_ASCII