#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
string oldfile;
string newfile;
oldfile = "/root/demo/c++/chapter_one/mv/file.txt";
newfile = "/root/demo/c++/chapter_one/mv/file_new.txt";
if(!rename(oldfile.c_str(),newfile.c_str()))
{
cout<<"rename success"<<endl;
}
else
{
cout<<"rename error"<<endl;
}
return 0;
}
c++ rename
最新推荐文章于 2024-05-15 15:55:08 发布