c++修改指定文件夹下所有文件扩展名
2017-01-13 15:16
183 查看
#include <io.h> #include <iostream> #include <cstring> #include <string> using namespace std; //读取文件夹设定 const string path = "D:\\pp\\"; int main(){ _finddata_t file; long lf; if((lf = _findfirst((path + "*.*").c_str(), &file))==-1) cout<<"Not Found!"<<endl; else{ // cout<<"file name list:"<<endl; while(_findnext( lf, &file)==0){ { string str=file.name; //修改扩展名为.jpeg str += ".jpeg"; //重命名文件 if (rename((path + string(file.name)).c_str(), (path + str).c_str()) == 0) { //cout << "1" << endl; } } } } _findclose(lf); return 0; }
相关文章推荐
- 批量修改指定文件夹下所有后缀名的文件为另外后缀名的java代码
- C++遍历指定文件夹中的所有文件
- c++遍历指定文件夹下的所有的文件
- C++ 将指定文件夹下的所有文件拷贝到另一文件夹下
- python查找指定文件夹下所有文件并按修改时间倒序排列
- win7基础 cmd del+*.扩展名 删除指定文件夹下的同一类型的所有文件
- 写了一个小东西: 修改指定文件夹下所有文件为不可识别文件,可还原!
- 获取指定文件夹下的所有文件+文件属性的获取与设置+文件夹属性的修改
- java实现批量修改指定文件夹下所有后缀名的文件为另外后缀名的代码
- 用批处理 将文件夹下的所有指定后缀名的文件,修改成自定义后缀名
- C#实现把指定文件夹下的所有文件复制到指定路径下以及修改指定文件的后缀名
- 关于C++中获取指定文件夹下的所有文件
- 遍历指定文件下所有的文件夹和文件的路径,文件名,修改日期,类型
- 统计一个文件夹下的所有文件并放入到一个txt中,并删除一些格式的文件,这个方法扩展,自己修改
- python查找指定文件夹下所有文件并按修改时间倒序排列的方法
- java实现批量修改指定文件夹下所有后缀名的文件为另外后缀名的代码
- java批量修改指定文件夹下所有后缀名的文件为另外后缀名的代码
- 黑马程序员—这是一个能够键盘录入路径去批量修改指定文件夹下所有指定文件内容的方法
- c++遍历指定文件夹下的所有的文件
- 将指定目录的所有文件及文件夹copy到指定目录下,只copy 7天内创建的或是7天内修改过的