Tom Schneider a écrit:
I wrote before:
EOF is not true on a reset empty file.
for GPC.
gpc 20040516, based on gcc-3.3.3
I just found in the book
PASCAL User Manual and Report, Fourth Edition ISO Pascal Standard, Kathleen Jensen and Niklaus Wirth 1991 page 158:
"A file is called \emph{empty} if its length is zero."
As you can see in the previous email, I created two empty files with echo -n "" > filename and then showed by three tests (file, ls and wc) that they were empty. In the GPC compiled program, I reset each file and then tested them and found that each was not at eof.
Strange. doing the same on DJGPP (W98se DOS box) with gpc 20041218 based on gcc 3.2.3 behaves as expected. All is done manually with suitable tools to binary visualize the true content of files, no shell scripts or functions which could be too intelligent (I have bash, no tcsh) and hide something "unimportant", for example no linefeed or ^Z (a DOS nicety on text files) added at the end.
A side comment: to make it work I needed to compile with gpc add the --transparent-file-name option to gpc (otherwise the filenames are asked at the beginning of the execution) Why did you not need it ?
Maurice