[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] ISO RndFile.OpenOld does not allow read and write
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] ISO RndFile.OpenOld does not allow read and write |
Date: |
Mon, 07 Jun 2010 12:35:06 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
SiTex Graphics <address@hidden> writes:
> 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.
Hi Scott,
many thanks for the bug report and test code - now fixed in the latest
cvs,
regards,
Gaius