-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_run.cpp
40 lines (38 loc) · 916 Bytes
/
test_run.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <glob.h>
#include <string>
#include <iostream>
#include <dirent.h>
using namespace std;
int main ()
{
//cout << "here1" << endl;
int result;
int j=0;
DIR *Dir;
struct dirent *DirEntry;
//cout << "here2" << endl;
Dir = opendir("./test/location/laptop/");
//cout << "here3" << endl;
if(!Dir) {
cout << "Fail\n";
}
//cout << "here4" << endl;
while((DirEntry = readdir(Dir)) != NULL) {
//cout << "here5" << endl;
string file = DirEntry->d_name;
//cout << "here6" << endl;
//cout << file;
//cout << "here7" << endl;
string filename = "./test/tags/favs/" + file;
//cout << "here8" << endl;
file = "./test/location/laptop/" + file;
//cout << file << " -> " << filename << endl;
if(j%10==0) {
cout << "file " << j << endl << endl;
}
j+=1;
result= rename( file.c_str() , filename.c_str());
}
return 0;
}