Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR and Directories
Message
De
20/05/2009 00:26:52
 
 
À
19/05/2009 15:53:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01400760
Message ID:
01400858
Vues:
57
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

=======================

>>If I issue ADIR(laArray, FullyQualifiedSubfolder + "\*.*", "D"), it will always return
>>at least 2 (for "." and "..") in its count of subfolders, even if FullyQualifiedSubfolder
>>is otherwise empty. Is there a way of getting
>>ADIR to ignore "." and "..", or must I always keep "." and ".." in mind
>>when checking for empty subfolders?
>>
>>-mark
>
>Mark,
>
>. and .. are not always included. You won't find them in eg adir(aa, 'c:\*.*', 'DHS')
>
>As Tamar answered, you'll have to deal with them, as in
>
>for i = 1 to  adir(aa, 'c:\*.*', 'DHS')
>   if( inlist(m.aa[m.i], '.', '..' ) )
>      loop
>  endif
>endfor
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform