Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The file( ) function and Windows NT Workstation
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00174822
Message ID:
00174846
Views:
26
>Hi everybody,
>
>I’am having a problem and I’m seeking some help. Here is the problem :
>
>Using Foxpro 2.6 for Windows, I’m testing the presence of a directory using the file( ) function, like this :
>
>
if file(‘c:\nul’)
>	? "Directory C:\ exist"
>else
>	? "Directory C:\ does’nt exist"
>endif
>
>It works on Windows 95, but it does'nt on WIndows NT Workstation. The file( ) function with a directory passed as parameters seems to always return false.
>
>I know that the file system is different in Windows NT Workstation. Can somebody help me to overcome this problem.
>
>tia

You might have to do it at a low-level file/open process by trying to create a bogus file.
lcTest   = "C:\MyDir\BogusFile.txt"
lnHandle = fcreate( lcTest )
llDirOk  = lnHandle > 0
if lnHandle > 0
  */ Ok to create the file, close it
  fclose( lnHandle )
  erase( lcTest )
endif
be sure to use a bogus filename because if it did have anything of value, it would be erased.
Previous
Reply
Map
View

Click here to load this message in the networking platform