Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADir and Long Filenames
Message
De
17/08/2005 08:37:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
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:
01041588
Vues:
23
>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

What does:

m.cFile
adir(aFile, m.cFile)
file(m.cFile)

show then? Is there an invalid path in m.cFile? For example "c:\my folder:myFile.txt"
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform