Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FSEEK() problems
Message
From
22/04/2003 18:09:24
J Chris Powell
Myers and Stauffer Lc
Kansas, United States
 
 
To
21/04/2003 08:05:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00779708
Message ID:
00780377
Views:
17
Hi Amanda,

This is a little hard to follow, but I'll do my best. The problem with large files is with fSEEK() and FEOF(). FSEEK(m.fhand,0,2) returns the present position if the file is over the 2GB limit. So, just after opening, the present position is 0. This is what you are seeing. FEOF() also returns .t. when record pointer is at 0 (or whereever it is) for large files. FREAD() seems to work correctly by moving the pointer and returning the string from the file. After the pointer moves, FSEEK(m.fHand,0,1) returns the correct position. However, each time FREAD() moves the pointer, FSEEK(m.fHand,0,2) erroneously returns the current position. (same value as FSEEK(m.fHand,0,1)) IOW, FSEEK(m.fHand,0,2) changes each time the record pointer is moved. FSEEK(m.fHand,n,0 or 1) seems to correctly move the pointer also.

The big problem is finding the end of the file, since FEOF() does not work with large files.

In the past, I've just used file splitter utilities (I think I sent you one) to break the files up into manageable sizes. This gives complete control, but ads another step. Alternatively, it may work to read the OS filesize and use that for FEOF().

Really testing these large files takes quite a bit of time, but I think this is all correct. Let me know if your findings are not consistent.

Thanks
Chris
Previous
Reply
Map
View

Click here to load this message in the networking platform