Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Directory() returns incorrectly?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00111589
Message ID:
00111801
Views:
16
>>I have a subdirectories on my machine f:\develop\myWork\temp and ..\data
>>
>>? directory('f:\develop\myWork\data') returns .T.
>>? directory('f:\develop\myWork\temp') returns .F. (sometimes .T.)?
>>? directory('data') returns .T.
>>? directory('temp') returns .F. (sometimes .T.)?
>>
>>What gives? I need to know if temp exists, if it doesn't I want to create it on the fly.
>>
>>Does anyone have a better solution to directory()? I don't trust it.
>>
>>Robert
>
>I've had bad results with DIRECTORY, and have found that ADIR() works better for me in many environments, especially with networks (NetWare has always been painful.) Rather than:
>
> IF DIRECTORY('Data')
>
>try:
>
> LOCAL aTestDir[1,5]
> IF ADIR(aTestDir,'Data','D')#0
>
>Additional attribute parameters can be added for hidden and system directory support. And you can explicitly examine aTestDir[] for details on each match, since the second argument can be a wildcard expression. ADIR() works reliably with UNCs and long filenames as well.
>
>hth,
>
>Ed

Thanks,
I like this idea the best.

Robert
Previous
Reply
Map
View

Click here to load this message in the networking platform