Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR and Directories
Message
From
20/05/2009 02:24:25
 
 
To
20/05/2009 00:26:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01400760
Message ID:
01400863
Views:
61
>Hmmmmm...thanks to all of you for the feedback.
>
>So, a DirectoryIsEmpty() function would be something like this:
>
>LPARAMETERS tcDir
>RETURN ADIR(laTemp, tcDir, "D") < IIF(OCCURS("\", tcDir) = 1, 1, 3)
>
>where tcDir ends in "\*.*"
>
>Is there a more elegant construct or dedicated function available?
>
>-mark
>
>=======================


Something like
function DirectoryIsEmpty(tcDir)

local aa[1] , n
n = adir(aa, addbs(m.tcDir) + '*.*', 'DHS')

return  empty(m.n) or ((m.n == 2) and (aa[1,1]=='.') and (aa[2,1] == '..') )
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform