Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the filename associated with a handle?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00112995
Message ID:
00113032
Views:
32
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform