[comp.lang.modula2] Bug in FST Filesystem module

Pat.Terry@p101.f4.n494.z5.fidonet.org (Pat Terry) (09/16/90)

There appears to be a bug in the FST Filesystem module.  For those of you with
sources, it is easy to correct.

I reported this to Roger Carvalho, and he has akske me to publicize the 
correction

PROCEDURE Reset( VAR f :File );
BEGIN
    SetPos(f,0,0);
    f.eof := FALSE;      (* <------ this line was missing *)
    f.res := done;
END Reset;

PROCEDURE Rewrite( VAR f :File );
VAR c   :CHAR;
    n   :CARDINAL;
BEGIN
    SetPos(f,0,0);
    f.eof := TRUE;       (* <-------- this line was missing *)
    writebytes(f.id,ADR(c),0,n);        (* truncate the file! *)
    IF errno = 0 THEN
        f.res := done
    END;
END Rewrite;

Roger can be reached by e-mail as CARVALHO_ROGER#PLANO@tandem.com

(note the underscore and the hash characters)




 




--  
uucp: uunet!m2xenix!puddle!5!494!4.101!Pat.Terry
Internet: Pat.Terry@p101.f4.n494.z5.fidonet.org