Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages
Started by Colin B Maharaj
Fri, 11 May 2007 09:53
32 bit File O and 64 Bit File IO
Author: Colin B Maharaj
Date: Fri, 11 May 2007 09:53
Date: Fri, 11 May 2007 09:53
31 lines
1858 bytes
1858 bytes
Hi all, just wondering, I have this application that does a lot of file processing and the size requirements of one of my installations may pass the 2 gig limit soon! I am using the BCB stock file routines like FileOpen, FileCreate, FileRead, FileWrite. I had realize some time back that there are both 64 and 32 bit routines in the same name now my questions: 1. Does the FileWrite routine writes pass 2 or 4 GIGs nowhere do I see that FileWrite is 64 bit based? 2. Similarly does the FileRead routine work pass the 2 or 4 GIGs point? . It is clear that FileSeek is both 64 and 32 bit based. So doe it mean that most of my recoding will be based on using a 64 bit file pointer for seek operations and thats it!! (?) I am using BCB6 on XP BTW: Should I switch to Vista Ultimate (got it as a gift!) Thanks Colin B Maharaj Programmer I-CNS Limited Trinidad WI.
Re: 32 bit File O and 64 Bit File IO
Author: Bob Gonder
Date: Fri, 11 May 2007 14:12
Date: Fri, 11 May 2007 14:12
29 lines
1975 bytes
1975 bytes
Colin B Maharaj wrote: >1. Does the FileWrite routine writes pass 2 or 4 GIGs nowhere do I see >that FileWrite is 64 bit based? Should not matter unless you are trying to write more than 4 GB in one call. (Notice that there is _no_ position argument, which would be the limiting file-size factor.) The limiting factor is the OS. You can use files as large as the underlying OS allows. >2. Similarly does the FileRead routine work pass the 2 or 4 GIGs point? Again, there is no positioning argument, so the size of the file does not matter. Only the size of your read matters. > It is clear that FileSeek is both 64 and 32 bit based. So >doe it mean that most of my recoding will be based on >using a 64 bit file pointer for seek operations and thats it!! (?) If it does use 64bit integers, then yes. (The 32/64 overload is seen on the Delphi, but not C++ help) Otherwise, you might look to the WinApi CreateFile() ReadFile() WriteFile() SetFilePointer() uses 2-32bit integers for a 64bit offset. SetFilePointerEx() uses 1-64bit integer.
Re: 32 bit File O and 64 Bit File IO
Author: Remy Lebeau (TeamB)
Date: Fri, 11 May 2007 16:59
Date: Fri, 11 May 2007 16:59
28 lines
1663 bytes
1663 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message news:46443D35.2050709@myhost.com... > Does the FileWrite routine writes pass 2 or 4 GIGs Yes. > nowhere do I see that FileWrite is 64 bit based? It doesn't need to be, because it doesn't deal with file offsets directly, so it doesn't care whether the current offset is past 2GB or not. > Similarly does the FileRead routine work pass the 2 or 4 GIGs point? Yes. > It is clear that FileSeek is both 64 and 32 bit based. So > doe it mean that most of my recoding will be based on > using a 64 bit file pointer for seek operations and thats it!! (?) File pointers have always been 64-bit at the OS level. SetFilePointer() has supported 64-bit file sizes for many years now. FileSeek(), however, did not utilize the higher 32 bits until BCB6. Gambit
Re: 32 bit File O and 64 Bit File IO
Author: Remy Lebeau (TeamB)
Date: Fri, 11 May 2007 17:00
Date: Fri, 11 May 2007 17:00
11 lines
1167 bytes
1167 bytes
"Bob Gonder" <notbg@notmindspring.invalid> wrote in message news:a1t8439ecms6dam3jiasc4nm3j4tbps17d@4ax.com... > If it does use 64bit integers, then yes. > (The 32/64 overload is seen on the Delphi, but not C++ help) The 64-bit overload of FileSeek() is in BCB6's help file. Gambit
Re: 32 bit File O and 64 Bit File IO
Author: Bob Gonder
Date: Fri, 11 May 2007 19:06
Date: Fri, 11 May 2007 19:06
9 lines
1360 bytes
1360 bytes
Remy Lebeau (TeamB) wrote: >"Bob Gonder" wrote in message > >> (The 32/64 overload is seen on the Delphi, but not C++ help) > >The 64-bit overload of FileSeek() is in BCB6's help file. Ah yes, so it is. Wonder why it's not in the BDS version?
Re: 32 bit File O and 64 Bit File IO
Author: Colin B Maharaj
Date: Sat, 12 May 2007 10:42
Date: Sat, 12 May 2007 10:42
58 lines
2558 bytes
2558 bytes
It was really simpler than I thought. Now my application can read/write to a 160GB file now (at least)! I did a lot of coding doing my own file io routines on an application I wrote many years ago before I know a hint about SQL (my/ms/oracle). The reporting is based on flat files. And folks still use it today. Just have to move everything to a RDBMS now or at least have this as an option for the SQL savvy user. Thanks for all the responses. Colin B Maharaj Full time developer php/xhtml/c++/javascript/css/cshell Trinidad, West Indies [ I Liberated myself from the ] [ Telecoms company I once worked ] Remy Lebeau (TeamB) wrote: > "Colin B Maharaj" <noreply@myhost.com> wrote in message > news:46443D35.2050709@myhost.com... > >> Does the FileWrite routine writes pass 2 or 4 GIGs > > Yes. > >> nowhere do I see that FileWrite is 64 bit based? > > It doesn't need to be, because it doesn't deal with file offsets > directly, so it doesn't care whether the current offset is past 2GB or > not. > >> Similarly does the FileRead routine work pass the 2 or 4 GIGs point? > > Yes. > >> It is clear that FileSeek is both 64 and 32 bit based. So >> doe it mean that most of my recoding will be based on >> using a 64 bit file pointer for seek operations and thats it!! (?) > > File pointers have always been 64-bit at the OS level. > SetFilePointer() has supported 64-bit file sizes for many years now. > FileSeek(), however, did not utilize the higher 32 bits until BCB6. > > > Gambit > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads