[Gdal-dev] CPLReadLine problem on windows platforms

Frank Warmerdam warmerdam at pobox.com
Fri Aug 29 13:35:01 EDT 2003


Roger James wrote:
> Frank,
> 
>  
> 
> CPLReadLine has a problem on windows platforms when passed a file 
> pointer that has been opened in text mode. The underlying removal of 
> carriage return characters by wijndows causes the fseek positioning to 
> be wrong.
...
> 
> This causes world file parsing to be wrong. My temp fix is in the above 
> snippet. I do not know if there are other places where this fix is need 
> or if it causes any side affects. But I can read jgw files on windows now J

Roger,

I see what you mean, and I have changed CSLLoad() to use the binary file type
when opening the file.  I am surprised this hasn't come up more.  Andrey is
also doing something recently with a CPLFGets() ... I don't know if this
could be related or not.

> I have a vague recollection about reporting this or a similar bug many 
> moons ago.

Hmm, I don't recall my I have a very lossy memory.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list