Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the a file name with proper case
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00766432
Message ID:
00766782
Vues:
31
Thanks Alex,

I definitely need to get the full path - I suppose I could walk the path and retrieve the directory names in proper case as well. Actually the solution using FindFirstFile etc. from Gregory works well for this.

>And what problem do you have with the GetLongPathName function? It may fail only if you pass invalid filename. Or, it returns the specified

It doesn't return the filename in the right case. It does in some cases, but not always (for example after you manually rename a file in the OS). It looks at some internal index that's different than the display name apparently.

+++ Rick ---

>>VFP has the unfortunate problem that all path related functions return filenames and paths in UPPER case. For example, GetFile() returns upper case as does FULLPATH() and even the varoius SYS() functions related to directory values return upper case.
>>
>>Does anybody know of an API call that you can pass a file or directory path to that will return the fully qualified long filename in proper case back? At least that way I can retrieve the filename and then later convert it into the proper case.
>>
>>I've played around GetLongPathName and GetFullPathName but neither of these seem to work and simply return the same case as what was passed in. THey basically confirm the file name and that the file exists.
>
>Hi Rick,
>
>If you wish to get a long filename in proper case (w/o path) you may use ADir() function, for sample:
>
lcFile = GetFile()
>ADir( laFiles, lcFile, "", 1)
>&& filename in UPPER case
>?JustFName( lcFile)
>&& long filename in Proper case
>?laFiles[1]
>
>And what problem do you have with the GetLongPathName function? It may fail only if you pass invalid filename. Or, it returns the specified path if no long path is found.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform