kullanarak nasıl değiştirebilirim Programı başlatırken current_path() ("C: \ workspace \ projects") kullanarak geçerli yolu yazdırmak istiyorum. Ve sonra yolu değiştirebilmek istiyorum, "c: \ program dosyaları" diyelim, böylece tekrar yazdırdığımda current_path() "c: \ program files" basılmak istiyorum. BuGeçerli yolu Boost.Filesystem
int main()
{
cout << current_path() << endl; // c:\workspace\projects
aFunctionToChangePath("c:\program files");
cout << current_path() << endl; // c:\program files
}
gibi bir şey ben bu Tamamladılar böylece eksik kütüphanede bir işlevi var mı?
boost::filesystem::path full_path(boost::filesystem::current_path());
std::cout << "Current path is : " << full_path << std::endl;
//system("cd ../"); // change to previous dir -- this is NOT working
chdir("../"); // change to previous dir -- this IS working
boost::filesystem::path new_full_path(boost::filesystem::current_path());
std::cout << "Current path is : " << new_full_path << std::endl;
zaman os özgü izin mi: – RedX
evet, onun da onun gibi – Kobe