Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Directory() returns incorrectly?
Message
From
25/06/1998 13:17:45
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/06/1998 13:12:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00111589
Message ID:
00111629
Views:
14
>>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
>Seeing even fullpath declaration fails for only "temp" I have a silly idea. Might any code RDing and MDing between these "? directory()" (Code may belong to someone else mapping to this work dir)?
>Cetin
And anyway for a solution I would do
cTempFile = "t"+sys(2015)+".tmp"
handle=fcreate("f:\develop\mywork\temp\"+cTempFile)
if handle >= 0
  =fclose(handle)
  erase (cTempFile)
else
  if adir("f:\develop\mywork\temp\") = 0  && Dir might exist but RO
    md "f:\develop\mywork\temp"
  endif
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform