Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File into memory
Message
De
16/02/2011 19:07:04
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/02/2011 14:10:30
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01500424
Message ID:
01500459
Vues:
58
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform