Previous mail
Next mail
Formatted
Overview 10 days
Subject
Date
Thread
Author
From gpc-owner@gnu.de Tue Feb 1 02:05:41 2005
Received: from mail.ncifcrf.gov ([129.43.100.101])
by adele.gerwinski.de with esmtp (Exim 4.34)
id 1CvmU4-0003Yp-8J
for gpc@gnu.de; Tue, 01 Feb 2005 02:05:36 +0100
Received: from mail.NCIFCRF.GOV(129.43.100.101) by AVAS3.ncifcrf.gov via smtp
id 706d_dd8fb286_73ec_11d9_9543_0002b3c7efef;
Mon, 31 Jan 2005 20:01:54 -0500 (EST)
Received: from strawberry.ncifcrf.gov (strawberry.NCIFCRF.GOV [129.43.6.74])
by mail.ncifcrf.gov (8.12.10/8.12.10) with ESMTP id j110rwd0012095
for <gpc@gnu.de>; Mon, 31 Jan 2005 19:53:58 -0500
Received: (from toms@localhost)
by strawberry.ncifcrf.gov (8.12.10+Sun/8.12.10/Submit) id j110rvla010073
for gpc@gnu.de; Mon, 31 Jan 2005 19:53:57 -0500 (EST)
Date: Mon, 31 Jan 2005 19:53:57 -0500 (EST)
From: Tom Schneider <toms@ncifcrf.gov>
Message-Id: <200502010053.j110rvla010073@strawberry.ncifcrf.gov>
To: gpc@gnu.de
Subject: Re: EOF is not true on reset empty file
X-Archive-Number: 200502/3
X-Sequence-Number: 5045
Maurice:
> Still please do the cross check. I have no Sun at hand do do it,
> and may be nobody in this list has exactly the same system.
> I know nothing on the inners of the Sun file system, whether
> it stores somewhere the fact that this is a binary or a text file,
> if the file length is obtained by looking truly to the file content,
> or to some information on the length stored somewhere outside of the
> file, etc. In DOS systems when running scandisk, you find sometimes
> an error message like "file length as reported by the system is different
> from the true file length"
Ok.
closetest.p: In main program:
closetest.p:20: error: undeclared identifier `close' (first use in this routine)
closetest.p:20: error: (Each undeclared identifier is reported only once
closetest.p:20: error: for each routine it appears in.)
The function 'close' is not standard Pascal. Since I'm not set up to
avoid standard Pascal (and I don't think it is critical, correct me if
I'm wrong please), remove those lines. A rewrite followed by a reset
empties the file.
********************************************************************************
strawberry 21% more closetest.p
program closetest(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/
*)
const
version = 1.00; (* of closetest.p 2005 jan 31 *)
var
namebook, namelist: text;
begin
rewrite(namebook);
{
close(namebook);
}
reset(namebook);
if eof(namebook)
then writeln(output,'eof of namebook')
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.
********************************************************************************
NOT eof of namebook
NOT eof of namelist
The program failed.
strawberry 15% ls -l nam*
-rw------- 1 toms delila 0 Jan 31 19:40 namebook
-rw------- 1 toms delila 0 Jan 31 19:40 namelist
strawberry 16% wc nam*
0 0 0 namebook
0 0 0 namelist
0 0 0 total
strawberry 17% file nam*
namebook: empty file
namelist: empty file
The files made by the Pascal program are indeed empty by these three
tests.
Regards,
Tom
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/
Previous mail
Next mail
Formatted
Overview 10 days
Subject
Date
Thread
Author
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).