calling the directory…
netmeeting ils
pinging…
[...] Then,
for example there's "blank line at the end of a file or no blank line",
for example Java-style has "no trailing line", here it's that
the files always have a trailing empty line, then that for
accounts like "cat all the files" that they're not ellided.
[...]
On 2026-11-22 18:04, Ross Finlayson wrote:
[...] Then,
for example there's "blank line at the end of a file or no blank line",
(Note that your wording is expressing a shifted perspective.)
for example Java-style has "no trailing line", here it's that
the files always have a trailing empty line, then that for
accounts like "cat all the files" that they're not ellided.
I've never heard about "blank line at the end of a file".
On 2026-11-23 05:06, Janis Papanagnou wrote:
On 2026-11-22 18:04, Ross Finlayson wrote:
[...] Then,
for example there's "blank line at the end of a file or no blank line",
(Note that your wording is expressing a shifted perspective.)
for example Java-style has "no trailing line", here it's that
the files always have a trailing empty line, then that for
accounts like "cat all the files" that they're not ellided.
I've never heard about "blank line at the end of a file".
I no longer see Ross's messages directly, only what's quoted in other people's responses.
Could he be referring to what the C standard says about text streams:
"Whether the last line requires a terminating new-line character is implementation-defined." (7.24.2p2 n3998.pdf)
I wouldn't describe that as "blank line or no blank line", but I could imagine it being misunderstood that way.
The C++ standard defines the behavior of many fundamental <iostream> functions in terms of the C standard library's routines, so I suspect
that this also applies to C++.
On 2026-11-23 05:06, Janis Papanagnou wrote:
On 2026-11-22 18:04, Ross Finlayson wrote:
[...] Then,
for example there's "blank line at the end of a file or no blank line",
(Note that your wording is expressing a shifted perspective.)
for example Java-style has "no trailing line", here it's that
the files always have a trailing empty line, then that for
accounts like "cat all the files" that they're not ellided.
I've never heard about "blank line at the end of a file".
I no longer see Ross's messages directly, only what's quoted in other people's responses.
Could he be referring to what the C standard says about text streams:
"Whether the last line requires a terminating new-line character is implementation-defined." (7.24.2p2 n3998.pdf)
I wouldn't describe that as "blank line or no blank line", but I could imagine it being misunderstood that way.
The C++ standard defines the behavior of many fundamental <iostream> functions in terms of the C standard library's routines, so I suspect
that this also applies to C++.
On 2026-11-24 05:15, James Kuyper wrote:[...]
[...]"Whether the last line requires a terminating new-line character is
implementation-defined." (7.24.2p2 n3998.pdf)
Working in POSIX environments, though, we have the certainty and we
need not rely on the (yet another) uncertainty that the C-standard
exposes here.
(Personally I'm not much concerned as I'm always creating terminated
lines in text-files. I'm also using an editor where the editor cares
about detecting and creating correct representations in files, and
which facilitates me to control that in (very rare) cases where I'd
need it.)
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
On 2026-11-24 05:15, James Kuyper wrote:[...]
[...]"Whether the last line requires a terminating new-line character is
implementation-defined." (7.24.2p2 n3998.pdf)
Working in POSIX environments, though, we have the certainty and we
need not rely on the (yet another) uncertainty that the C-standard
exposes here.
(Personally I'm not much concerned as I'm always creating terminated
lines in text-files. I'm also using an editor where the editor cares
about detecting and creating correct representations in files, and
which facilitates me to control that in (very rare) cases where I'd
need it.)
Here's what POSIX says.
[snip]
So as far as C is concerned, a non-empty file not ending in a newline
may or may not be a text file, but in POSIX it is not. And yes,
many tools will, at least by default, ensure that a created or
updated non-empty text file will end with a newline character.
But there are text-like files that don't end in a newline character
(or that have lines exceeding LINE_MAX bytes), and I expect the
tools I use to deal with such files reasonably, even if POSIX
does't require it.
Here's what POSIX says....
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html
3.185 Line
A sequence of zero or more non-<newline> characters plus a
terminating <newline> character.
3.387 Text File
A file that contains characters organized into zero or more
But there are text-like files that don't end in a newline character
(or that have lines exceeding LINE_MAX bytes), and I expect the
tools I use to deal with such files reasonably, even if POSIX
does't require it.
Note I read the specification as LINE_MAX bytes including the newline character.
Interestingly the spec says "bytes" not "characters". I wonder if it is
using the age-old definition of "byte" being the size of a character (as
in C) or the modern popular one of "octet".
data: api.nasa.gov (APOD, NeoWs)
| Sysop: | cequra |
|---|---|
| Location: | Grimsby United Kingdom |
| Users: | 4 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 498853:01:48 |
| Calls: | 197 |
| Files: | 8,821 |
| D/L today: |
29 files (9,432K bytes) |
| Messages: | 39,038 |