PRB: File() Function Ignores Path if Given in Parameter (243542)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q243542 SYMPTOMS
The File() function documentation states that you can include a path with the file name to search for a file in a directory or on a drive other than the current directory or drive. Under certain conditions the File() function can return .t. even though the file does not exist in the path given in the parameter.
CAUSE
If the file exists along the Visual FoxPro path, the function returns .t..
RESOLUTION
Use the Adir() function. Supply the file name you are checking for as the second parameter in the Adir() function. The Adir() function returns 1 if the file is found.
nFilesFound=adir(atemp,"C:\temp.txt")
IF nFilesFound=1
&& Do processing on file
ELSE
&& File does not exist
ENDIF
Modification Type: | Major | Last Reviewed: | 10/27/1999 |
---|
Keywords: | kbCodeSnippet kbDSupport kbprb kbXBase KB243542 |
---|
|