Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening a file in binary mode
Message
De
04/09/2001 12:00:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
04/09/2001 11:57:09
Héctor Lizarraga
Gobierno Del Edo de Querétaro
Querétaro, Mexique
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00552106
Message ID:
00552109
Vues:
20
>How can i open a file in binary mode?
>I need this because I want to send small chunks of the file through the winsock control.
>
>Thanks in advance
>Héctor L.

In VFP 6 or later, just copy the file to a memory variable with FileToStr(). Then you can get individual bytes with substr().

For older versions of VFP, use the old-fashioned approach (still useful in some situations) of low-level functions: fopen(), fread(), fclose(). fgets() is oriented towards text-files only, so you won't use it here.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform