Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search entire drive for a file
Message
From
28/02/2003 15:29:55
 
 
To
28/02/2003 15:20:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00759634
Message ID:
00759642
Views:
31
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform