Hi all,
I have several large raw binary files (>20MB). I need to do some
subsampling from those files, however, it appears that Delphi is running
right by the EOF long before it ever should.
I know that any given scan line in these datafiles are less than 10000,
so I have created a variable:
bytebuffer : array[0..10000] of Byte;
and I open the file. When I do a FileSize, it returns only 175000, not
21,000,000! My first trial is to subsample at a rate of 12. Thus I read
in the first data line with:
BlockRead(fin, bytebuffer, linelength, result);
where linelength for the test file is 7200. Result returns 31? :-(.
Then the program merrily skips through the array pulling every 12th
element -- it does this first line correctly.
Then I do a Seek with my new file position being my current position +
11*linelength, which should drop me at the proper place, which it almost
does (79220 bytes in, not 79189 bytes...) before it reads in the next
line of data.
It does this a couple times until the file position is greater than the
FileSize. Sadly, the data it pulls within the first 175000 bytes is
valid, but afterwards, it is like it did go beyond the EOF. Can anyone
give some suggestions to dealing with this?
I know my algo works as it is a straight port from some solid C code.
--
Cheers,
------------------------------------------------------------------------------
Christopher M. Keane ke...@jei.umd.edu
Research Associate ke...@earthsun.umd.edu
Joint Education Initiative
3433 A. V. Williams
University of Maryland at College Park
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| Flames > /dev/nul |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/