Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using FOPEN() and FREAD()
Message
De
03/06/1999 14:24:32
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, Californie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00225449
Message ID:
00226130
Vues:
25
Thanks David. I hadn't thought of that difference between FGETS() and FREAD(). Apparently all I need is the first byte, but your precaution is well received.

>
>One clarification since you are dealing with binary data. FREAD() will work, FGETS() may fail to return what you expect because it'll stop at the first instance or chr(10) and/or chr(13) and these are both bytes that may occur within the binary data.
>
>>Under 5.0, in the command window, when I issue x=FOPEN('mytable.dbf'), x becomes the file handle of the opened file. When I issue =FREAD(x,100) or FGETS(x,100), I get what I thought would be the first 100 bytes of the table -- the header and then some -- but I can't read it. Is there some trick to this and interpreting what's returned? I'm trying to evaluate the first byte in the header to know if I'm dealing with a usable/readable DBF. All I get is '0c' followed by a bunch of graphic characters, then eventually readable A-z, 0-9 readable text.
>>
>>Any direction greatly appreciated.
Ernie Veniegas
Micro System Solutions
... sensible software by design
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform