Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening a file in binary mode
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00552106
Message ID:
00552353
Vues:
22
>>Ok, but what happen when the file is very large? More than 1 MB
>
>If you have the available memory, you can use FiletoStr(). It will suck the entire file into memory. VFP's string capacity can hold a great deal larger than 1 MB (I have created strings in excess of 1 GB for tst purposes).
>
>If you don't have the memory available, then you have to use the LLFF as Hilmar posted. Use FSeek() to position the file pointer and FRead() to read portions of the file into memory. It will probably take longer but the some of the memory contraints don't apply.

Larry, actually, when you will read in portions of 100-300KB, usually such algorithms go MUCH more quickly than reading entire string into the memory and working with it. When string is large, there might be memory swapping to disk, as well as certain VFP string functions work slowly over long strings. In addition, many VFP functions have limitation to 16MB string length, though string could be much longer ;)
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform