Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: Frank Heckenbach
Subject: eof bug in GPC
Date: 15 Sep 2005, 21:49:01
Tom Schneider wrote:
> I reported a bug in GPC some months ago:
>
> http://www.gnu-pascal.de/crystal/gpc/en/mail11285.html
>
> Basically, GPC fails to report eof = true after a reset when a file is
> empty. In the Replies, Waldek Hebisch provided a patch:
>
> http://www.gnu-pascal.de/crystal/gpc/en/mail11309.html
>
> Recently someone in Hong Kong was working with my programs and the bug
> was still there. I think she has the most recent version of GPC,
Does she? Perhaps she has 20041218?
> so
> the patch apparently has not been implemented.
>
> I had to make a rather horrible kludge to get around this. Basically
> I have a function, emptyfile, to replace eof. If it counts less than
> 2 characters in a file, that file is deemed 'empty'. In my cases this
> will work because the relevant files have more than two characters if
> they are not empty, but of course it will not work in general!
>
> Does anyone know the status of this patch? Will it be put into GPC?
> If not, why not?
It has been included:
@item 20050130: in standard Pascal modes, @samp{EOF} is false on an empty file (tom7.pas)
tom7.pas:
{$classic-pascal}
program gpcbug2005jan27({namebook, namelist, } output);
(*
Dr. Thomas D. Schneider
National Cancer Institute
Laboratory of Experimental and Computational Biology
Molecular Information Theory Group
Frederick, Maryland 21702-1201
toms@ncifcrf.gov
permanent email: toms@alum.mit.edu (use only if first address fails)
http://www.lecb.ncifcrf.gov/~toms/
modified by Maurice Lombardi and Frank Heckenbach
*)
const
version = 1.00; (* of gpcbug2005jan27.p 2005 jan 27 *)
var
namebook{, namelist}: text;
begin
rewrite(namebook);
{close(namebook);}
reset(namebook);
if eof(namebook)
then writeln(output,'OK')
else writeln(output,'NOT eof of namebook');
{
rewrite(namelist);
close(namelist);
reset(namelist);
if eof(namelist)
then writeln(output,'eof of namelist')
else writeln(output,'NOT eof of namelist');
}
end.
Frank
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
| Author | Subject | Date |
|---|---|---|
| Tom Schneider | eof bug in GPC | 15 Sep 2005, 12:25:24 |
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).