News for hackers. Stuff that matters.
Re:What's New in POSIX 2024 by rascul on Tuesday October 29, 2024 @08:31AM (#41983203)
An empty file is not hard to make. It's just a matter of creating the file and not writing to it.
Re:What's New in POSIX 2024 by WJW on Tuesday October 29, 2024 @08:56AM (#41983380)
Yes obviously. But the POSIX specification for a "text file" as above is that it contains characters, which an empty file by definition does not. So an empty file cannot be a text file if you read that specification strictly, and therefore you cannot have zero lines in a text file. As soon as you have a single character there is at least one line, and the amount of lines can only stay the same or grow from there.

The definition should read "one or more lines" instead or (probably better) specify that a text file contains "zero or more characters".

Re:What's New in POSIX 2024 by rascul on Tuesday October 29, 2024 @09:43AM (#41983768)
Ahh I see what you're saying. I misunderstood at first.