Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File into memory
Message
From
16/02/2011 19:07:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
16/02/2011 14:10:30
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01500424
Message ID:
01500459
Views:
57
>if has been a while but I am sure that fread() will leave the file pointer ready to get the next xx bytes. The only problem is fread() will stop at the first carriage return and ignore the number of bytes. The docs did not say if fgets() will leave the file pointer at the correct place my I would not be surprised if it didn't. So if that is the case then you will be able to get rid of all the fseek() calls.

I think you got it switched around. fRead() doesn't stop at a CR, fGets() does.

For stuff like this, I'd usually read a decent chunk of the file, 16K or 32K, process it until the last delimiter, then chop there and add the next read chunk to the remainder of the first one. The speed gain over reading it byte by byte was about tenfold (ten years ago - with today's Windows it may be different).

But if it's only to split into lines at tildes, my money's on Tore's solution. Cause that's what I'd do (or maybe have done already, can't remember).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform