Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search entire drive for a file
Message
De
28/02/2003 15:29:55
 
 
À
28/02/2003 15:20:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00759634
Message ID:
00759642
Vues:
34
This message has been marked as the solution to the initial question of the thread.
>I know this has been posted before, but I cannot locate it using the search feature for some reason. I need the ability to search an entire drive for a specific file 'archeadr.dbf' and it needs to function on Win95, Win98, Win2k, and WinXP without having to install WSH or anything else. Will an API function work?
>
>Any ideas anyone?
>
>TIA,
>Tracy

This is David Frankenbach's sample code from an article he wrote in a wiki. It ought to get you where you want to go.

Alan
ltStart = datetime()

create cursor tempfiles ( cFilename c(80), nSize n(10), dMod d )

RecurseFolder( "c:\" )
? datetime() - ltStart

index on nSize tag nSize

browse nowait

function RecurseFolder( lcDir )
local i,n, laFiles[1]

?? "."
n = adir( laFiles, lcDir + "*.*", "shd" )

for i = 1 to n
   if ( left( laFiles[i,1], 1 ) != '.' )
      if ( "D" $ laFiles[i,5] )
         RecurseFolder( lcDir + laFiles[i,1] + "\" )
      else
        insert into tempfiles ;
               values( lcDir + laFiles[i,1], laFiles[i,2], laFiles[i,3] )
      endif
   endif
endfor
return
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform