Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FindFirstFile
Message
 
 
To
20/06/2001 16:32:09
Alex Zhadanov
Computer Generated Solutions
New York City, New York, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00521676
Message ID:
00521714
Views:
20
>Hi,people
>I need to find file somewhere on a harddrive.
>I have filename and drive (c: or e:)
>I want to use API FindFirstFile to find this file.
>How can i present WIN32_FIND_DATA structute which this API require?
>Thank you

Alex,
It appears you are assuming that FindFirstFile only needs to know the file name and drive letter i.e. it will automatically search sub-directories - this is not the case.

You are better off either:
- using Filer.DLL (see VFP documentation) if your application is not intended for distribution
- writing your own recursive routine using the native ADIR() and ASCAN() functions
- running a command shell e.g.
  CD C:\
  cFileSpec = "MyFile.Dbf"
  RUN DIR &FileSpec. /s > c:\temp\results.txt
  cResults = FILETOSTR( "c:\temp\results.txt" )
  IF cFileSpec $ cResults THEN
     *- Extract path.
  ENDIF
- using Scripting.FileSystemObject
censored.
Previous
Reply
Map
View

Click here to load this message in the networking platform