Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the filename associated with a handle?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00112995
Message ID:
00113032
Vues:
31
>Your point is well taken but, the reason I need know this is to determine whether my open error is being cause my this file already being opened and not properly closed. In this case all you get is a -1 handle and ferror() returns and message telling you that there has been an open error. All I need to know is whether my file failure is due to the file already being opened or not.
Juan,

You can write some defensive code around your FOpen() as in;
IF FILE("MyFile.txt")
   lnHandle = fOpen("MyFile.txt")
   IF lnHandle < 0
      * You know the file exists so it must be another problem
   ENDIF
ELSE
   lnHandle = fCreate("MyFile.txt")
   IF lnHandle < 0
      * There was a creation error
   ENDIF
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform