Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADir and Long Filenames
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01041216
Message ID:
01041581
Vues:
33
Paul,

The FILE() and ADIR() will not see files marked as system or hidden. Could that be the case? For ADIR() you can specify the third parameter "SH" to make it see such files.

>I agree that adir() and file() work with long filenames, or at least I used to :)
>
>(I am using VFP9 on a Windows XP SP2 machine)
>
>Here is a sample function where I try a number of different "configurations":
>oTest = CreateObject("FileProps")
>oTest.Testthis(getfile())
>Return
>
>Define Class FileProps as Custom
>   Function Testthis(cFile)
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile,"C:\Documents and Settings\paulj\Local Settings\Application Data\CustomersDiff.xml")
>	? type('afile[1]')
>
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile, cFile)
>	? file(cFile)
>	? type('afile[1]')
>
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile, (cFile))
>	? file(cFile)
>	? type('afile[1]')
>
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile, "&cFile")
>	? file(cFile)
>	? type('afile[1]')
>
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile, '"'+(cFile)+'"')
>	? file(cFile)
>	? type('afile[1]')
>
>	Release aFile
>	Dimension aFile[1]
>	=ADir(afile, ('"'+cFile+'"'))
>	? file(cFile)
>	? type('afile[1]')
>
>	Wait window "Done"
>   EndFunc
>EndDefine
>This code will work as expected "most of the time". When it works, any of the "configurations" yield the correct results. When it doesn't work, none of them do. I'm not quite sure why yet, but sometimes this same code acts as if the file in question does not exist. Sometimes it depends on the folder/file I choose and sometimes I think it matters whether the function is inside a class or not.
>
>If I open the debugger and step through the code:
>
> =adir(aFile, cFile) Yields "Expression cannot be evaluated"
>
> =file(cFile) Yields .F.
>
>Thank you for your help,
>Paul
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform