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:
01041649
Vues:
23
Paul,

I changed your =adir(,,,) to a ? adir(...) and for every file I've picked with getfile it works printing 1,.t., C.

For the first case I get a 0 and L because I don't have a paulj\Local Settings\Application Data folder on my system.

I have Windows Explorer set to display hidden and system folders so if I navigate into the folders appropriate on my machine in the getfile dialog and pick a file it still works. I tested a hidden folder on another machine in my network and it works ok.

Have you seen any pattern to which files do work and which ones don't on your system? I'm also testing this in VFP9 on an XPSP2 notebook machine.

Update: Is it possibly a rights issue? ie some users are being allowed to navigate to a folder in getfile() that they don't really have access to?

>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
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform