C/C++ C++ g++: error: Setup: No such file or directory Hatası

Aytuğ123

Femtopat
Katılım
3 Eylül 2023
Mesajlar
6
Daha fazla  
Cinsiyet
Erkek
Merhaba Kod :
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>

using namespace std;
namespace fs = std::filesystem;

int main()
{
string kaynakDosya = "yardimciKomut.exe";
string hedefDizin = "C:\\Windows\\System32"; // Çift ters eğik çizgi ile kaçış dizilerini kullanın
fs::path kaynakYolu = fs::current_path() / kaynakDosya;
fs::path hedefYolu = hedefDizin / kaynakDosya; // fs::current_path() kullanmanıza gerek yok

try {
fs::rename(kaynakYolu, hedefYolu);
cout << kaynakDosya << " dosyasi " << hedefDizin << " dizinine tasindi." << endl;
}
catch (const std::exception &e) {
cout << e.what() << endl;
}

return 0;
}
 

Technopat Haberler

Yeni konular

Geri
Yukarı