Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for a locked file
Message
 
To
25/04/2005 10:53:54
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
01008092
Message ID:
01008216
Views:
16
>Hello,
>I was wondering if anybody had a good way to check for a locked file? I am moving a list of files, and can't have the error message pop up when I don't have access to one of them. Thanks for the help!
>
>MAC

Mike,
you can open each file with UDF usefile(myfile)
my_file = 'd:\all_zapl\b_data\allvar'

lopen = USEFILE(my_file)
IF lopen
   MESSAGEBOX('All is Ok')
ELSE
   MESSAGEBOX('Bad news')
ENDIF

FUNCTION USEFILE(open_file)
LOCAL lretval
TRY
  USE (open_file)
  lretval = .t.
CATCH
ENDTRY
RETURN lretval
HTH
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform