gm2
[Top][All Lists]
Advanced

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

RE: [Gm2] IOChan.RawRead() returns fewer bytes than available


From: Breeden, Thomas (tmb)
Subject: RE: [Gm2] IOChan.RawRead() returns fewer bytes than available
Date: Thu, 25 Feb 2010 12:11:53 -0500


> -----Original Message-----
> From: address@hidden [mailto:gm2-
> address@hidden On Behalf Of Gaius Mulley
> Sent: February 25, 2010 10:46 AM
> To: SiTex Graphics
> Cc: GM2
> Subject: Re: [Gm2] IOChan.RawRead() returns fewer bytes than available
> 
> SiTex Graphics <address@hidden> writes:
> 
> > Hi Gaius,
> >
> > The RawRead() function in GM2 exhibits some unexpected behavior
> > compared to the XDS and Stonybrook versions.  RawRead() sometimes
> > returns fewer than the number of bytes requested even when there are
> > more bytes remaining in the file.  I've attached a simple test module
> > which tries to read a file named test.dat.  Compile with
> >
> > gm2 -fiso -fmakeall -o readtest readtest.mod
> >
> > Every 16000-30000 bytes there is a short read.  I'm not sure if this
> > is a bug (does the ISO spec address this?), but it is unexpected.  I
> > have my own wrappers for all the file IO functions, and coding around
> > this behavior was simple enough once I discovered what was
> > happening.
> 
> Hi Scott,
> 
> thanks for the report - the standard doesn't mention short reads - so
> I suspect it should not happen.  I've fixed this now in the latest
> cvs,

ISO sez:

IOResult.ReadResult(cid: IOChan.ChanId):ReadResults

after an RawIO.Read()

will return one of these three ReadResults:

   allRight       if items are read for all components;
   wrongFormat    if some items are read, but not for all components;
   endOfInput     if no items are read, the input having ended.

so it appears that a short read is accommodated, but it must be up to
the program to determine what it might mean.

regards,

Tom





reply via email to

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