gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] ISO RndFile.OpenOld does not allow read and write


From: SiTex Graphics
Subject: [Gm2] ISO RndFile.OpenOld does not allow read and write
Date: Tue, 1 Jun 2010 23:02:29 -0400

Hi Gaius,

ISO RndFile.OpenOld does not allow read and write on the same channel.
 Test module below.  Compile with

gm2 -o append -fiso -fmakeall append.mod

The test module opens an existing file named test.txt with read and
write access and then writes 5 bytes.  At runtime the binary aborts in
RawWrite with

this file (test.txt) was opened for reading but is now being written

Regards,
Scott


MODULE append;

FROM SYSTEM IMPORT ADR;
IMPORT IOChan, ChanConsts, RndFile;

TYPE
  File = IOChan.ChanId;

VAR
  fi : IOChan.ChanId;
  res : ChanConsts.OpenResults;
  buf : ARRAY [0..5] OF CHAR;

BEGIN
  RndFile.OpenOld(fi,"test.txt",RndFile.read+RndFile.write,res);
  IF res=ChanConsts.opened THEN
    buf:="hello";
    IOChan.RawWrite(fi,ADR(buf),5);
    RndFile.Close(fi);
  END;
END append.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]