Nom de fichier dos

cs_ageof Messages postés 7 Date d'inscription dimanche 12 novembre 2000 Statut Membre Dernière intervention 26 mai 2005 - 26 mai 2005 à 16:50
ymca2003 Messages postés 2070 Date d'inscription mardi 22 avril 2003 Statut Membre Dernière intervention 3 juillet 2006 - 26 mai 2005 à 18:12
Bonjour,

Pour un fichier donné, je souhaite obtenir son nom Dos.

MERCI !

4 réponses

nawakator Messages postés 51 Date d'inscription lundi 12 mai 2003 Statut Membre Dernière intervention 8 février 2011
26 mai 2005 à 17:38
Utilse les ceci :

LPWIN32_FIND_DATA pDataFic;
char * pfile;
void * ret;


// Rechercher donnée fichier
ret = FindFirstFile(pfile , pDataFic);
// Si fichier trouver
if (ret != INVALID_HANDLE_VALUE)
{
// Dans l'objet pDataFic->cAlternatFileName y'a le nom avec les ~
}
// Fermer recherche
FindClose(ret);

N.B: cela permet aussi de faire l'inverse !!!

Bye
0
cs_ageof Messages postés 7 Date d'inscription dimanche 12 novembre 2000 Statut Membre Dernière intervention 26 mai 2005
26 mai 2005 à 17:39
MERCI bq !!!!
0
MetalDwarf Messages postés 241 Date d'inscription mardi 29 octobre 2002 Statut Membre Dernière intervention 23 janvier 2006
26 mai 2005 à 17:41
si le nom fait moins de 8 lettres (+3 d'extension), alors c est celui
ci en majuscules (de toute facon MS-DOS n est pas sensible a la casse),
sinon c est les 6 premieres lettre, et ensuite ~x, avec x le numero du
fichier (en general, 1).
0
ymca2003 Messages postés 2070 Date d'inscription mardi 22 avril 2003 Statut Membre Dernière intervention 3 juillet 2006 7
26 mai 2005 à 18:12
[mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN98\98VSa\1036\winbase.chm::/devdoc/live/pdwbase/errors_3uwi.htm GetLastError].


Remarks

When an application calls this function and specifies a path on a volume that does not support 8.3 aliases, the function fails with ERROR_INVALID_PARAMETER if the path is longer than 67 bytes.


The path specified by lpszLongPath does not have to be a fully qualified path or a long path. The short form may be longer than the specifed path.


If the specified path is already in its short form, there is no need for any conversion, and the function simply copies the specified path to the buffer for the short path.


You can set lpszShortPath to the same value as lpszLongPath; in other words, you can set the buffer for the short path to the address of the input path string.


You can obtain the long name of a file from the short name by calling the FindFirstFile function.
0
Rejoignez-nous