Question

Y at-il une fonction qui renvoie le nom de chemin complet pour tout fichier entré est?

Je pense à quelque chose comme:

LPCSTR path = "foo.bar"
LPCSTR fullPath = FullyQualifiedPath(path);
//fullPath now equals C:\path\to\foo.bar

Merci

Était-ce utile?

La solution

Dans Win32, appelez le GetFullPathName fonction.

Autres conseils

Utiliser boost :: système de fichiers http://www.boost.org/doc /libs/1_44_0/libs/filesystem/v2/doc/index.htm

#include <iostream>
#include <boost/filesystem.hpp>

int main()
{
    boost::filesystem::path p = boost::filesystem::complete("foo.bar");
    std::cout << p;
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top