Re: Create files larger than 2GB with open or CreateFile?
"Nick Shallery" <nicknide@hotmail.com> wrote in message
news:A3F5EF45-7356-42B7-AE3F-D68E0F5E1FDC@microsoft.com...
SetFilePosition? you mean is SetFilePointer?
Yes, The new API SetFilePointerEx can be used.
Yeah that's what I meant. Anyhow the MSDN docs for those functions are
messed up b/c I don't think SetFilePointer was introduced in Win2k, but
that's what the page says.
OT: The suspicion is that someone doesn't understand the difference between
having an OS supporting a library function (that is having an
implementation) and Microsoft offering support for an OS in the sense of
security patches, and thus is removing the old OSes from the programmer
documentation as their security support expires.
"Ben Voigt [C++ MVP]" <bvoigt@newsgroup.nospam> 4?????
news:OYICxaW2JHA.4272@TK2MSFTNGP06.phx.gbl...
Tim Roberts wrote:
"Tim Jones" <timj@tolisgroup.com> wrote:
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote:
"Tim Jones" <timj@tolisgroup.com> wrote:
I'm moving a slew of code from Solaris to Windows and one issue
that I've run into is the creation of files larger than 2GB. I've
searched MSDN, but everything is either about DB access or RAM.
Under Solaris, I use a flag O_LARGEFILE in the modes flag.
However, I don't find a similar documentation for any Windows file
creation API menber. Is this possible (understanding that we are
only working with NTFS filesystems)?
Nothing special needed with the native APIs (CreateFile, ReadFile,
WriteFile).
That's what I thought, but I'm getting write failures as soon as I
hit the 2GB point.
That won't happen with standard WriteFile calls on an NTFS file
system. It can happen with a memory-mapped files. However, remember
that most removable devices (USB drives, USB flash drives) use FAT
file systems, where there are such limits.
Also even the Win32 APIs require special care, for example the OVERLAPPED
structure requires you to fill out two fields instead of one, to identify
the offset in a file > 2GB, SetFilePosition requires special attention,
etc.
Are you using stdio calls (fopen, fwrite)?
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4103 (20090525) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4103 (20090525) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com