|
From: Roumen P. <bug...@ro...> - 2008-12-23 09:29:34
|
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 |