gm2
[Top][All Lists]
Advanced

[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
Subject: Re: [Gm2] ISO RndFile.OpenOld does not allow read and write
Date: Wed, 30 Jun 2010 11:28:04 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

SiTex Graphics <address@hidden> writes:

> Hi Gaius,
>
> Thanks for the fix.  The OpenOld function now succeeds, but there is
> another problem.  Add the following line to the example prior to the
> write:
>
> RndFile.SetPos(fi,2);
>
> Create a file named test.txt with at least 8 chars.  The test program
> should write the characters hello starting at file position 2;
> instead, it writes hello starting at file position 0.
>
> -Scott

Hi Scott,

now fixed in the latest cvs - thanks for the bug report,

regards,
Gaius

> On Mon, Jun 7, 2010 at 7:35 AM, Gaius Mulley <address@hidden> wrote:
>> 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
>>
>
> _______________________________________________
> gm2 mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/gm2



reply via email to

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