Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with file names having not English characters
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Working with file names having not English characters
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Divers
Thread ID:
01087582
Message ID:
01087582
Vues:
65
The situation is like this:
There are files coming on CDs that are delivered from various countries. Files need to be copied to the hard drive, and renamed. (Then they should be processed depending on their type).
The new name should contain the original name, and additional ID or time stamp.
File FULL file name, not its shortname, should be used.


The problem is that when the file name contains not English characters, then the file full name is not recognized or it is not properly recorded.
The example:

The file having name “_1HelloЗемля.jpg” is visible in Windows Explorer where
it can be manually copied, renamed as needed, etc.
But the code does not work:
*Adir(…) function gives “_1Hello?????.jpg” and this name is not recognized 
* with the file() function.

oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFile = oFSO.GetFile(getfile()) && gives an error ‘Unknown Com status code’

FOR EACH oitem IN oFSO.GetFolder("c:\").Files
	WITH oitem
		IF  "_1"$.name
			? .name  && returns“_1Hello?????.jpg”
*     .COpy() method does not work here also, error ‘Unknown Com status code’

		ENDIF
	endwith
ENDFOR
Anyone has ideas or recommendation? Thanks in advance
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform