1c88 Subj : Re: Large Files To : borland.public.cpp.borlandcpp From : Trandog Date : Sat Sep 13 2003 04:22 pm Thanks for your quick response. Below are the versions that I have available. ============================================================================== 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 ============================================================================ From CBuilder: the about box states: Professional 3.0 (Build 3.70) ============================================================================= I began using Borland C in the early 1990's and migrated through several versions (3,4,5) until Borland became Inprise. I then fought with my collegues to keep Borland instead of switching to Microsoft. Each new version caused me problems in converting my processes. Several years ago, Borland staff told me that there were no changes in the C compiler, and it was probably not worth my effort to update. But, now, I see that I probably have to. I really do not want to go through the hassle, but I guess that is life. Recent changes have now caused me to deal with new platform issues as stated below. The largest headache is the large file sizes. You recommended before that I look at different processes, and I switched to the Windows API's for I/O. I had used stream opeations in the past in order to keep my code compatible with Unix, but that is probably not as important at this date. A collegue and I have developed commpatible dll's that we use interchangably: he writes in Delphi, and I write in C. It works very well, and I didn't want to rock the boat by doing any switching. 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. I have to check the platform before I call system(). We have decided against using CreateProcess for certain reasons. The system I write has to run in both Windows and command line as a series of dll's invoked by either command line, batch processes, or Windows launchers, (most of the time in the background) so CreateProcess is not really a viable solution. 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 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. (I beleive it either related to reading very short records, or file mis-positioning by SetFilePointer.) The .exe works correctly in Win9x. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Ed Mulroy [TeamB] wrote: > There is no Borland C and is no Borland C++ 5.3. Please check and tell us > what version you are using. > > I am using XP and have had no problems with SetFilePointer. Since the call > is directly to the underlying Windows API there should be no compiler > involvement that would make a compiler version dependency on if it correctly > worked. Make sure that the code checks both the return value from the > function and the value it places into the high DWORD whose pointer you pass > on the call. If you are passing NULL as that pointer's value then a call to > GetLastError may be in order (if you do then do not forget to call > SetLastError(0); before the call). > > The free compiler is the set of command line tools from C++ Builder version > 5. It is C++ Builder and is handled in C++ Builder newsgroups, groups with > the word 'cppbuilder' in the name. For instance: > > borland.public.cppbuilder.commandlinetools > borland.public.cppbuilder.nativeapi > > C++ Builder uses ilink32.exe for the linker, just as Borland C++ did. > Unlike Borland C++, it does not come with the older linkert Te new linker > is well established and tlink.exe does not support some of the newer > features needed in a linker. > > >>I have also noticed, in WinXP, that system() needs to be enclosed >>within "..." when it contains " in the text. I have been able to code >>around this problem, ... > > > I do not understand. Please restate. Show some code. > > >>... do I really need to update my compiler and linker? > > > If you are using Borland C++ then you are using a compiler that is 6 years > old. Most of the Windows operating systems in use were not around back > then. You should have upgraded long ago. > > >>Does the latest version deal with pos_t as __int64, and if so, >>how does one use it both ways (int-- for old existing code and >>__int64 for newer code)? > > > What is pos_t? That symbol is not in any header file on my machine. > > >>... does the latest C (5.5.1) compiler eliminate the system dependencies? > > > Version 5.51 is not the lastest compiler. The latest compiler is C++ > Builder 6 whose bcc32.exe reports itself as 5.6.4. I know of no version of > Borland C++ which has system dependencies of the sort to which you allude. > > . Ed > > >>Trandog wrote in message >>news:3f635a7a$1@newsgroups.borland.com... >> >> In August I sent in a question re large files (> 4GB)using >>Borland C. At that time I mis-stated that I was using Borland >>3, when I really was using v 5.3. I have taken the responded >>suggestion and have converted my processes where I >>expect large files to use CreateFile, ReadFile, SetFilePointer, >>etc. That seems to work fine on my Win9x PC's, but using >>SetFilePointer seems to randomly set invalid values when >>running under WinXP. Are there diferences that I need to >>know about when using these routines. >> >>I have also noticed, in WinXP, that system() needs to be >>enclosed within "..." when it contains " in the text. I have been >>able to code around this problem, but does the latest C (5.5.1) >>compiler eliminate the system dependencies? I >>downloaded the free C compiler (5.5.1), but Tlink32 does not seem to come > > with > >>it. This prevents me from using most of my procedures to compile and link >>(actually, I can't link when I compile with 5.5.1 -- probably wrong > > libraries ). > >>My BCC32 5.3 compiler came with my update of CBuilder 3.0. I am not that >>interested in Cbuilder as I do all command line compiling and linking. > > What do > >>I really need to update my compiler and linker? Does the latest version > > deal > >>with pos_t as __int64, and if so, how does one use it both ways (int-- for > > old > >>existing code and __int64 for newer code)? >> >>Thanks for any help on this subject. >> > > > . 0