c++移动文件夹

bool Files::MoveSampleFolder(string src_path,string dst_path)
{
    int index = src_path.find_last_of("\\");
    string tem_path = src_path.substr(index);

    dst_path = dst_path + tem_path;

    rename(src_path.c_str(),dst_path.c_str());
    return true;

}

src_path 待移动文件夹

dst_path存放路径

Files是自己定义的一个类,可无视

posted @ 2015-05-12 10:15  Daringoo  阅读(965)  评论(0编辑  收藏  举报