Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FileSystemObject
Message
 
 
À
04/06/2002 12:51:21
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00664585
Message ID:
00664736
Vues:
17
>Hi,
>I am using the FileSystemObject to delete a file.
>but before I delete it i want to check if it is in use by another user, since otherwise the system aborts.
>How do I check if a file is opened by another user with the filesystemobject?
>Id appreciate any help with this.

You can use local error handler or create wraper class to intercept that error. ALternatively, you can do it with VFP commands.
lnFH = FOPEN(lcFileName, 12)
IF lnFH > 0    && file isn't in use
  FCLOSE(lnFH)
  DELETE FILE (lcFileName)
ENDIF
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform