Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if a text file is in use
Message
From
11/08/2003 07:48:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/08/2003 18:02:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00815356
Message ID:
00818831
Views:
23
>A better question might be, HOW to determine the low-level Handle of a Text file that is already open?
>
>Obviously we can use FOPEN() to retrieve an error code, and FERROR() likewise. However there seems to be no way to access a file which was previously opened... and no way to close it, or otherwise re-Open with a new Handle.

Yes,
But this is a bad programming. If you need a variable somewhere else then you need a way to keep it in scope.
Sergey's suggestion of listing status works to a point. It lists the files as shortened for display paths. IOW you might be closing the wrong one.
lnMAX = 32767 && I don't know what to chose for this actually
for ix=1 to lnMAX
 fclose(ix)
endfor
works to close all opened. Might get handles from list status output.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform