Frage

Gibt es eine Funktion, dass die Renditen für die vollständig qualifizierten Pfadnamen für jede eingegebene Datei?

Ich denke an so etwas wie:

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

Danke

War es hilfreich?

Lösung

In Win32, rufen Sie die GetFullPathName Funktion.

Andere Tipps

Mit boost :: filesystem 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;
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top