Subj : Re: Large Files To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Sat Sep 13 2003 04:07 pm Trandog wrote: >============================================================================== > From my standard: (bcc32) >Borland C++ 5.3 for Win32 Copyright (c) 1993, 1998 Borland International >============================================================================= > From the free download (bcc32) >Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland Of the 3, that is the newest, and the one I use just fine. Did you apply all of the patches for it? >============================================================================ > From CBuilder: the about box states: >Professional 3.0 (Build 3.70) >============================================================================= > >The system problem I mentioned is that the command: >"c:\Program Files\myprog.exe" "Arg 1" "arg 2" will not work as the string in >system() under XP, but will under Win9x. For Win XP, NT, 2K, the command has to >be: ""c:\Program Files\muprog.exe" "Arg 1" "arg 2"", but that does not work >in Win9x. So, you're saying what? system("c:\Program Files\myprog.exe" "Arg 1" "arg 2"); works??? I don't think so. But this should system( "\"c:\\Program Files\\myprog.exe\" \"Arg 1\" \"arg 2\"" ); >My 5.3 C compiler works fine with the Win API calls for large files with several >exceptions: > >If I write a lot of short records with WriteFile, the system hangs. If I buffer How short? One Byte? What options (if any) for dwFlagsAndAttributes do you use when opening those files? In a multi-user system, you want FILE_FLAG_WRITE_THROUGH. You should also have one of FILE_FLAG_RANDOM_ACCESS or FILE_FLAG_SEQUENTIAL_SCAN depending on how you use the file. >the writes myself, and write larger records, I have no problems. The very same >code with the Win API routines replaced with file stream routines works with no >problems, except when the file sizes get too large. Also, in WinXP, the >ReadFile operations randomly fail. In what way do they fail? Do you check returned values? > (I beleive it either related to reading very >short records, or file mis-positioning by SetFilePointer.) The .exe works >correctly in Win9x. If the hFile file handle was opened with the FILE_FLAG_NO_BUFFERING flag set, an application can move the file pointer only to sector-aligned positions. So, don't set that flag in CreateFile(). .