large file support in runtime

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

large file support in runtime

Farkas Levente
hi,
what is the current status of large file support in the runtime? i found
this patch in one of my old rpm for runtime. is there anything like this
included in upstream release? if not is there any plan to support large
files in the near future? eg inlcude such a patch in the upstream release?
thanks in advance.
yours.

--
  Levente                               "Si vis pacem para bellum!"

diff -Nur mingw-runtime-3.14.orig/include/io.h mingw-runtime-3.14/include/io.h
--- mingw-runtime-3.14.orig/include/io.h 2007-12-27 15:21:39.000000000 +0100
+++ mingw-runtime-3.14/include/io.h 2008-03-29 02:02:40.343750000 +0100
@@ -333,6 +333,10 @@
 
 #endif /* Not _NO_OLDNAMES */
 
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#define lseek _lseeki64
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff -Nur mingw-runtime-3.14.orig/include/sys/stat.h mingw-runtime-3.14/include/sys/stat.h
--- mingw-runtime-3.14.orig/include/sys/stat.h 2007-12-27 15:21:40.000000000 +0100
+++ mingw-runtime-3.14/include/sys/stat.h 2008-03-29 02:02:40.343750000 +0100
@@ -187,6 +187,13 @@
 #endif /* _WSTAT_DEFIND */
 #endif /* __MSVCRT__ */
 
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+#undef stat
+#define stat  _stati64
+#define fstat _fstati64
+#define wstat _wstati64
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff -Nur mingw-runtime-3.14.orig/include/sys/types.h mingw-runtime-3.14/include/sys/types.h
--- mingw-runtime-3.14.orig/include/sys/types.h 2007-12-27 15:21:40.000000000 +0100
+++ mingw-runtime-3.14/include/sys/types.h 2008-03-29 02:02:40.359375000 +0100
@@ -35,7 +35,11 @@
 
 #ifndef _OFF_T_
 #define _OFF_T_
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+typedef long long _off_t;
+#else
 typedef long _off_t;
+#endif
 
 #ifndef _NO_OLDNAMES
 typedef _off_t off_t;

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: large file support in runtime

Tor Lillqvist
> what is the current status of large file support in the runtime?

The runtime, i.e. the Microsoft C library, in all its incarnations,
and the underlying (NT-based) Windows operating systems, support large
files just fine. You just have to look in the header files for the
correct functions names and types to use.

What you might actually be asking is, do the *header files* support
using large-file aware code directly as on Linux (or other modern
POSIXes) without ifdefs in the code. That I don't know the answer to.

--tml

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: large file support in runtime

Farkas Levente
Tor Lillqvist wrote:

>> what is the current status of large file support in the runtime?
>
> The runtime, i.e. the Microsoft C library, in all its incarnations,
> and the underlying (NT-based) Windows operating systems, support large
> files just fine. You just have to look in the header files for the
> correct functions names and types to use.
>
> What you might actually be asking is, do the *header files* support
> using large-file aware code directly as on Linux (or other modern
> POSIXes) without ifdefs in the code. That I don't know the answer to.

yes that's exactly what i asking for. is it planed? is it acceptable or not?

--
  Levente                               "Si vis pacem para bellum!"

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: large file support in runtime

Erik de Castro Lopo
In reply to this post by Tor Lillqvist
Tor Lillqvist wrote:

> The runtime, i.e. the Microsoft C library, in all its incarnations,
> and the underlying (NT-based) Windows operating systems, support large
> files just fine. You just have to look in the header files for the
> correct functions names and types to use.

While this is true, be very careful because while MS may have implemented
a bunch of POSIX system calls, their implementations are often buggy and
inconsistent.

For instance, I found a that fstat and stat have some very strange and
unexpected behaviour on all version of windows up to an including
Vista:

    http://www.mega-nerd.com/erikd/Blog/Windiots/posix.html

Over the years I have found many other similar wierd inconsistencies
on various versions of windows.

My solution is to avoid MS's broken POSIX layer and instead write a
wrapper around the CreateFile/ReadFile/WriteFile/SetFilePointer win32
API and use that instead. With these functions, at least you have a
fair chance that MS has tested them and made sure they work.

HTH,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"I'm too fucking busy, or vice versa" -- Dorothy Parker

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.
Reply | Threaded
Open this post in threaded view
|

Re: large file support in runtime

Roumen Petrov
Erik de Castro Lopo wrote:

> Tor Lillqvist wrote:
>
>> The runtime, i.e. the Microsoft C library, in all its incarnations,
>> and the underlying (NT-based) Windows operating systems, support large
>> files just fine. You just have to look in the header files for the
>> correct functions names and types to use.
>
> While this is true, be very careful because while MS may have implemented
> a bunch of POSIX system calls, their implementations are often buggy and
> inconsistent.
>
> For instance, I found a that fstat and stat have some very strange and
> unexpected behaviour on all version of windows up to an including
> Vista:
>
>     http://www.mega-nerd.com/erikd/Blog/Windiots/posix.html
>
> Over the years I have found many other similar wierd inconsistencies
> on various versions of windows.
>
> My solution is to avoid MS's broken POSIX layer and instead write a
> wrapper around the CreateFile/ReadFile/WriteFile/SetFilePointer win32
> API and use that instead. With these functions, at least you have a
> fair chance that MS has tested them and made sure they work.
>
> HTH,
> Erik

Above is not only related to the POSIX layer. In link is sample for stat
and fstat. I'm not sure that "Expolorer" use those functions. If I
remember well "Explorer" show incorrect file size for files written by a
program but still open. I'm not sure that flush resolve issue.

Roumen



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

_______________________________________________
This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.