Re: Reading LAST line from text file without iterating through the
file?
On 02/27/2011 09:13 AM, Arne Vajh??j wrote:
On 27-02-2011 08:55, Ken Wesson wrote:
On Sat, 26 Feb 2011 16:35:09 -0700, Jim Janney wrote:
The programs I work on run under Windows JVMs but still read and write
files on the AS/400 (or whatever IBM is calling it this month) file
system.
Perhaps, but if the OP's code is for working with Unix log files -- well,
who the heck is likely to store Unix log files on an AS/400 box? The Unix
machines networked with the hypothetical AS/400 box will no doubt store
their log files on their own hard drives, not the AS/400 box's.
I don't think that it is good to give advice on how
to read the last line from a text file in Java based
on an assumption that it must be a Unix log file when the
OP did not indicate so.
In this forum people all the time try to make the claim that an OP meant
something not in the original post. For example, the other thread where the
OP asked how to produce a 'List <String1>' and everyone (except me) assumed
and argued that they *must* have meant 'List <String>', even though they took
great pains not to say so.
So I would expand your advice to add that one eschew assuming anything outside
the problem statement. Beyond that, because this is a discussion forum and
not a help desk, it is entirely appropriate to discuss the general
applicability of principles elicited from a specific problem. Thus, even if
the OP did want to speak only of log files, it is important and highly
relevant to point out that "text files" (about which they actually did ask)
have a wider and fuzzer meaning that certain ignorant trolls would believe.
--
Lew
Honi soit qui mal y pense.