Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for a locked file
Message
 
À
25/04/2005 10:53:54
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Divers
Thread ID:
01008092
Message ID:
01008216
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform