>>>>>Just wondering if anyone out there known or have written code to locate a file within the foxpro environement. Basically, I am looking for a function that when i give it a file name and it returns the path where the file reside in the current directory.
>>>>>
>>>>>Any help is appreciated ....
>>>>>
>>>>>Thanks in advance.
>>>>
>>>>Do you mean LOCFILE() or GETFILE()?
>>>
>>>I know the fullpath() command but it is not what i am looking for... Basically,
>>>if i know the name of a file but yet dont know where it is in the directory. It is similar to the search command in file mananger where you type in a file name and it returns all the files found in the search path ....
>>
>>You still can:
>>SET PATH TO &cSearchpath.
>>cPathname=LOCFILE(cFilename)
>
>Hmmm ... not quite what i wanted ... May be i didnt explain it well.
>
>if i have the default directory as t:\app
>and the path is empty. In the directory app, i have a subdirectory called dbf and the file i am searching for is in the dbf. LOCFILE will not find the file in this case and the dialog box will pop up...
If you don't want dialog the you use FILE() first:
SET PATH TO &cSearchpath.
IF FILE(cFilename)=.T.
cPathname=LOCFILE(cFilename)
ENDIF
Edward Pikman
Independent Consultant