begin process at 2012 02 11 22:12:35
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

Fichier / Disque

 > 

nom de fichier dos


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

nom de fichier dos

jeudi 26 mai 2005 à 16:50:12 | nom de fichier dos

ageof

Bonjour,

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

MERCI !
jeudi 26 mai 2005 à 17:38:30 | Re : nom de fichier dos

nawakator

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

jeudi 26 mai 2005 à 17:39:32 | Re : nom de fichier dos

ageof

MERCI bq !!!!
jeudi 26 mai 2005 à 17:41:07 | Re : nom de fichier dos

MetalDwarf

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).
jeudi 26 mai 2005 à 18:12:07 | Re : nom de fichier dos

ymca2003

GetShortPathName

The GetShortPathName function obtains the short path form of a specified input path.

DWORD GetShortPathName(   LPCTSTR lpszLongPath,  // pointer to a null-terminated path string   LPTSTR lpszShortPath,  // pointer to a buffer to receive the                           // null-terminated short form of the path   DWORD cchBuffer        // specifies the size of the buffer pointed                           // to by lpszShortPath );  

Parameters

lpszLongPath
Pointer to a null-terminated path string. The function obtains the short form of this path.
lpszShortPath
Pointer to a buffer to receive the null-terminated short form of the path specified by lpszLongPath.
cchBuffer
Specifies the size, in characters, of the buffer pointed to by lpszShortPath.

Return Values

If the function succeeds, the return value is the length, in characters, of the string copied to lpszShortPath, not including the terminating null character.

If the function fails due to the lpszShortPath buffer being too small to contain the short path string, the return value is the size, in characters, of the short path string. You need to call the function with a short path buffer that is at least as large as the short path string.

If the function fails for any other reason, the return value is zero. To get extended error information, call 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.



Cette discussion est classée dans : fichier, dos


Répondre à ce message

Sujets en rapport avec ce message

lire fichier sonore DOS [ par istdasklar ] Ququn peut m indiquer un site ou je pourais apprendre ou avoir un code pour lire des fichier sonores wav, midi, voc, n importe koi du moment que c'est tasm32 [ par jeannot_ ] Salut!J'aimerais executer un prog en asm. Qd je le compile sous dos (le fichier  .asm),  tout est nickel et j'obtiens un fichier  ".obj". Je n'arrive convertir format mac to dos [ par deutant ] en compilant un fichier c++ que j ai récupére du net, l erreur suivante est apparue:error C4335: Format de fichier Mac détecté : convertissez le fichi Du Dos à un fichier texte [ par moumoucha ] bonjour;SVP;est ce que vous pouvez m'aider à transférer l'affichage du DOS obtenu après l'éxécution de mon programme sur un fichier texte;c'est vrmnt gestion des étudiants avec des fichier en C sous dos [ par tun86 ] Bonsoir Mdm & Mr, J'ai un gros problem avec ajout et modification d'un fichier sous windows avec c.j'aimerai bien que vous m'aidé a cette manip. Good [DEBUTANT C] Modifier fichier texet [ par JeanMarcP ] BonjourJ'ai besoin, sur un vieux PC sous DOS, de modifier un fichier texte de la façon suivante :Entre les 23ème et 24ème virgule, je dois ajouter le parser un fichier .dfm [ par vieri31 ] Bonjour Je veut trouver un moyen pour parser un fichier *.dfm pour determiner des paramètres d'une interface faite avec borland c++ ou pour déterminer FIchier Introuvable dans les fichiers internet temporaires [ par iguypouf ] Bonjour à tous,Je ne sais pas si ça vient de mon appli ou de la config d'internet.J'ai une appli locale en C++ qui marche parfaitement avec IE6 : un f Problème avec le fichier oledb.h [ par romauto750 ] Bonjour à tous, j'ai un problème dont je ne comprend rien.En compilant mon projet, j'ai eu tout à coup alors que ça marchait quelques minutes avant de EOF à une position donnée [ par layoutl ] Bonjour, Je cherches a savoir si il est possible par le C et les API win 32, de dire : A partir de cette offset du fichier, celui-ci est terminé. E


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,201 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales