Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if a text file is in use
Message
De
31/07/2003 09:47:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/07/2003 09:36:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00815356
Message ID:
00815359
Vues:
16
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform