[gdal-dev] CPLStat + VSI_REG fails on larger files on Windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] CPLStat + VSI_REG fails on larger files on Windows

Martin Landa
Hi,

I am having a problem with code in VFK driver checking file by CPLStat
+ VSI_REG. On larger files (2GB+) this check fails, but only on
Windows. The same file works on Linux.

Any idea what is wrong? Thanks a lot for any pointer. Martin

[1] https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/vfk/vfkreader.cpp#L82

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: CPLStat + VSI_REG fails on larger files on Windows

Even Rouault-2

On mardi 22 mai 2018 08:41:35 CEST Martin Landa wrote:

> https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/vfk/vfkreader

> .cpp#L82

 

CPLStat() ultimately calls _wstat() on Windows. Looking at

https://docs.microsoft.com/en-gb/cpp/c-runtime-library/reference/stat-functions , it seems it can only deal with 32-bit file length

 

You could just replace your CPLStat() call with VSIStatL() (and use a VSIStatBufL structure) that will use a 64-bit ready Windows API underneath.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: CPLStat + VSI_REG fails on larger files on Windows

Martin Landa
Hi,

2018-05-22 9:18 GMT+02:00 Even Rouault <[hidden email]>:
> CPLStat() ultimately calls _wstat() on Windows. Looking at
>
> https://docs.microsoft.com/en-gb/cpp/c-runtime-library/reference/stat-functions
> , it seems it can only deal with 32-bit file length
>
>
>
> You could just replace your CPLStat() call with VSIStatL() (and use a
> VSIStatBufL structure) that will use a 64-bit ready Windows API underneath.

thanks for explanation, should be fixed in [1]. Issue open [2] due backports.

Ma

[1] https://github.com/OSGeo/gdal/commit/6a2e8bc23a5e72753f7222b6e59c081cc2f076a0
[2] https://github.com/OSGeo/gdal/issues/637

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev