Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if a text file is in use
Message
From
31/07/2003 09:47:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/07/2003 09:36:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00815356
Message ID:
00815359
Views:
15
>is there a way for VFP to determine if a text file is in use? we work a lot with text files and i use the file() function often to see if a file exists. i also use the used() function to determine if tables are in use. so i guess i am looking for a textfileused() function.
>
>thnx,
>
>vm

Try to open lowlevel. If you can than is not in use. ie:
local llInUse
lnHandle = fopen('myFileName.txt',12)
if lnHandle > 0
  fclose(lnHandle)
else
  if ferror() = 5
     llInUse = .t.
  else
     * Another error - file not found, too many files etc 
  endif
endif
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
Next
Reply
Map
View

Click here to load this message in the networking platform