Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Folder existence using FILE()
Message
 
 
À
18/09/2001 03:29:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00557314
Message ID:
00557713
Vues:
8
< SNIP >

>Mark,
>As Sergey said you'd change your checks to something like IsDir(lcPath).
>I meant asm was exception, if you don't need special folders that adir() can't access than go with adir(). ie (w/o error checking):
>
>
function IsDir
>lparameters tcPath
>private lnFiles
>lnFiles = adir(arrDummy,tcPath+'\*.*','D')
>return lnFiles > 0 and arrDummy[1,1]='.' and 'D'$arrDummy[1,5]
>Cetin

It would return incorrect result if directory is empty. Here's working version
PARAMETER cDirectory
PRIVATE aDir
cDirectory = ALLTRIM(cDirectory)
IF RIGHT(cDirectory,1) = "\"
    cDirectory = LEFT(cDirectory, LEN(cDirectory)
ENDIF
RETURN ADIR(aDir, cDirectory, "D") > 0
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform