[Patch, libfortran] PR 40812 Large file support on MinGW

Janne Blomqvist blomqvist.janne@gmail.com
Thu Dec 3 16:57:00 GMT 2009


On Thu, Dec 3, 2009 at 12:41, Kai Tietz <ktietz70@googlemail.com> wrote:
> Interesting was that my last patch just worked as the restoration seek
> use SEEK_CUR, which puzzled me a bit. Finally I found the real issue
> here in the patch.
> First I cleaned up this this temporary variable for comparison with
> INVALID_HANDLE_VALUE. This define is a pointer already, and so no
> scalar cast is necessary here.
> Secondly for the seek to position to be truncated, FILE_CUR was used,
> but of course it has to be seeked from beginning of file by
> FILE_BEGIN.

Yes, I misread the description for SetFilePointerEx on MSDN, or rather
I didn't read it and just assumed it would work like POSIX lseek().
Attached is a further revised version of the patch that uses lseek
(which is as of this patch redefined as _lseeki64 on MinGW). Also, it
tries to seek back to the original position in case something went
wrong in order to make it behave more like ftruncate().


-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-lfs3.diff
Type: text/x-patch
Size: 5136 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091203/a4716626/attachment.bin>


More information about the Fortran mailing list