>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
ENDIF
- using Scripting.FileSystemObject
censored.