Microsoft KB Archive/95373

{| = PRB: FoxPro FILE Function Returns Wrong Results on Network =
 * width="100%"|

ID: Q95373

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS
When you use the FILE function to test for the existence of a network directory, a logical true (.T.) is always returned regardless of the actual existence of the directory.

RESOLUTION
To work around this problem, use the ADIR function. For example:

IF ADIR(test,'Z:\mydir\*','D') <> 0 WAIT WIND &quot;Z:\mydir exists&quot; ENDIF This example assumes that the array &quot;test&quot; has not yet been defined. If the ADIR function returns a number greater than zero, then the directory exists.

MORE INFORMATION
Using the FILE function in this way has been found to be unreliable on network drives.

The syntax of the command is:

?FILE('Z:\mydir\nul') Additional reference words: FoxDos FoxWin 2.00 null 2.50 2.50a KBCategory: kbprg kbprb KBSubcategory: FxnetworkGeneral
 * }