how to check if the a recursive scan is pointing to the folder from which it started its recursive scan ?
Let's say I am starting my recursive scan at folder C:\test. That is my beginfolder (beginfolder = C:\test)
Then the recursive scan scans some other folders such as C:\test\folder1.
after it is done scanning C:\test\folder1 , it continues scanning at the folder
C:\test again.( because a recursive scans scans all the files in folder alphabetically)
How do i check that the folder path that the dir is pointing to is equal to "C:\test again ?
"the current folder that dir is pointing to is not the beginfolder"
i would like to have set some condition where the current folder path that dir is pointing to is not equal to the beginfolder , so if we have a folder path that is anything different from "C:\test" for example a file path name of C:\test\folder1 would satisfy the condition.
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
|
path beginfolder = dir->path();
cout << beginfolder << endl;
cout << beginfolder << endl;
while (dir != end)
{
if (is_directory(dir->status())) //folder
{
cout << "folder" << absolute(dir->path()) << endl;
++dir;
while (dir != end && is_regular_file(dir->status()) && "the current folder that dir is pointing to is not the beginfolder")
{
cout << "file in folder" << absolute(dir->path()) << endl;
++dir;
}
}
else // regular file
{
cout << "file" << absolute(dir->path()) << endl;
++dir;
}
|