News for hackers. Stuff that matters.
Re:You can do a lot with an empty file by michaelhoffman on Wednesday April 06, 2022 @08:38PM (#30939251)
> A file that contains characters organized into zero or more lines. The lines do not contain NUL characters and none can exceed {LINE_MAX} bytes in length, including the <newline> character. Although POSIX.1-2017 does not distinguish between text files and binary files (see the ISO C standard), many utilities only produce predictable or meaningful output when operating on text files. The standard utilities that have such restrictions always specify "text files" in their STDIN or INPUT FILES sections.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...

Re:You can do a lot with an empty file by macintux on Wednesday April 06, 2022 @11:07PM (#30940202)
Does an empty file contain characters? That first sentence seems like it contradicts itself.
Re:You can do a lot with an empty file by brianpan on Thursday April 07, 2022 @02:27AM (#30941269)
Yes. It contains zero characters.

An empty file actually contains zero of everything in the universe.

Re:You can do a lot with an empty file by dfox on Thursday April 07, 2022 @08:56AM (#30943807)
The idea behind the definition is that it defines set of files that will not trigger various bugs in traditional unix text tools implementations (ie. various variants of not checking the fgets() return value).
Re:You can do a lot with an empty file by nerdponx on Thursday April 07, 2022 @02:23AM (#30941243)
I think the implication is that empty files are considered text files.