Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scanning for a file that is open
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Scanning for a file that is open
Divers
Thread ID:
00878210
Message ID:
00878210
Vues:
68
I am trying to find out whether a list of users in my application are in the application. I have a user table named users. This list all users. Each user has a unique user number stored in the table. In a directory named Profiles I have a directory for each user with the name of the user being the name of the directory. An example of the user table:
Name              Number

Paul              100
Simon             120
In the profile directory you would see:
U:\Profiles\User100
U:\Profiles\User120
When a user logs into the system there is a file named insystem.dbf in the profile directory which is opened. Therefore what I would like to do is to scan the user table to grab the users. Then goto the equivalent PROFILE directory numbers and determine whether each of there insystem.dbf files are open. If they are open I would like to list the username in a list box. Here is my code to date. I cannot get this working for some reason I get a function, argument is invalid.
SET EXCLUSIVE OFF
SET DELETED ON

Select users.userno, users.username ;
  from "U:\Questpdm\Data\Users" ;
  ORDER BY users.username ;
  into array arrUsers

if ( _Tally > 0 )
for ix = 1 to alen(arrUsers,1)
  If File("U:\QuestPDM\Profile\User"+ltrim(str(arrUsers[ix,2]))+"\insystem.dbf")
    lnFID = Fopen("U:\QuestPDM\Profile\User1\insystem.dbf", 12)
    If lnFID = -1
      MessageBox("User "+trim(arrUsers[ix,1])+" is in system")
    Else
      Fclose(lnFID)
      MessageBox("User "+trim(arrUsers[ix,1])+" is not in system")
    ENDIF
  ENDIF
 ENDFOR
endif
Can anybody help me please?
Neil Lewis
IT R&D Manager
Velmore Ltd
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform