Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low Level Function question
Message
De
03/01/2002 10:16:34
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00600268
Message ID:
00600273
Vues:
19
>I'm using low level file fuctions to log certain miscellaneous errors to a text file (I generally log all errors to the SQL Server database this app uses - but if I can't get a connection, or the append fails, I use the text file).
>
>If the file already exists, I open it using FOPEN, then move the pointer to the end of the file using Fseek(lnFileHandle, 0, 2) and then tried using both FPUTS and FWRITE to append to the file.
>
>This didn't work and I'm not sure why. When I changed the code to read the contents of the file to a variable using FILETOSTR and then adding to the variable before using FPUTS, it worked OK. Is this the only way to do this - or is it possible to append to a text file using the low level functions without using FILETOSTR first?


Hi,

When you FOPEN, by default it is READ ONLY. Did you specify a second parameter to enable writes?

e.g.

lnHandle = FOPEN(lcFilename,2)
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform