Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to trap error - File Access is denied
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00694551
Message ID:
00694572
Views:
26
fopen() called here with parameter 2, meaning READ and WRITE. You can not write to the file if you do not have exlusive access to it. fopen() returns (-1) if it cannot open the file for any reason.

As in VFP Help:
"...If FOPEN( ) successfully opens the file, the file handle number of the file is returned. FOPEN( ) returns –1 if the file cannot be opened...."

In any case you can not use fopen() more than ones for the very same file (it will fail on the second attempt).

>If the file handle returned is not -1, then the file is opened. But how does the return value of the file handle <= 0 mean that someone else has it open? Is a file handle assigned each time the file is oepned, and then startign with 0 or 1?
Previous
Reply
Map
View

Click here to load this message in the networking platform