
please wait
|
|
for()
condition.Exception thrown: boost::filesystem::directory_iterator::construct: Access is de nied: "C:\$Recycle.Bin\S-1-5-18" |
boost::filesystem::directory_iterator::construct: Access is denied: "C:\Config.Msi" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Program Files\WindowsApps" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Crypto\RSA\S-1-5-18" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Network\Downloader" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Search\Data" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\AppRepository" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\LocationProvider" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\Power Efficiency Diagnostics" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\SystemData" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows Defender" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows NT\MSFax" boost::filesystem::directory_iterator::construct: Access is denied: "C:\System Volume Information" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\AppCompat\Programs" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\AUInstallAgent" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\LiveKernelReports" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Logs\HomeGroup" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Logs\SystemRestore" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Logs\WindowsBackup" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Minidump" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\ModemLogs" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\PLA\Reports" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\PLA\Rules" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\PLA\Templates" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Prefetch" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\Resources\Themes\aero\VSCache" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\security\audit" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\security\cap" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\ServiceProfiles\LocalService" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\ServiceProfiles\NetworkService" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\Com\dmp" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\config" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\LogFiles\Fax\Incoming" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\LogFiles\Fax\Outgoing" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\LogFiles\Firewall" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\LogFiles\WMI" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\MsDtc" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\networklist" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\sru" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\Tasks" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\Com\dmp" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\config" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\MsDtc" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\networklist" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\sru" boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\SysWOW64\Tasks" |
boost::filesystem::directory_iterator::construct: Access is denied: "C:\Windows\System32\LogFiles\WMI\RtBackup" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\LocationProvider" boost::filesystem::directory_iterator::construct: Access is denied: "C:\ProgramData\Microsoft\Windows\SystemData" boost::filesystem::directory_iterator::construct: Access is denied: "C:\System Volume Information" |
Either way, the simple fix is to allow the skipping of these directories, and I need to find out how. |
|
|
1. We don't need the user to start a recursion, and we don't need to keep track of the current level of recursion, since it is kept internally by the iterator. 2. Using a while loop does not look very natural in this context, but incrementing a recursive_directory_iterator could result in an exception, and we want it to be managed inside the loop, since we don't want the looping to be interrupted while an error happens before we terminate scanning all the elements. 3. Interestingly and usefully, recursive_directory_iterator stores in its status the current recursion level. 4. Actually, this functionality was in checkAndDump(), now we divorced it from dump() and let it live on its own. Another change is regarding what we actually do when we detect that we have at hand a directory that is also a symbolic link: we call no_push() on the iterator, that basically says not to go into the directory, but skip to the next element. That is exactely the behaviour we want in this context. 5. As said above, moving a recursive_directory_iterator could result in an exception (for instance, if the next element is a directory and we have no read access on it). 6. We couldn't access the next item in the collection, so we assume it refers to a directory that we can't access, and we ask the iterator class not to navigate in that directory but skip to the next element. 7. OK, this line should be written in a more expanded way, and we should try to recover in a more graceful way in case of troubles. But let just assume our previous assumption ("bad" directory) was right so that the catch clause is almost a paranoid check. |
fsysclass.cpp: In function 'std::vector<std::basic_string<char> > sub_stuff_suppliment(const string&)': fsysclass.cpp:309:65: error: 'createRIterator' was not declared in this scope boost::filesystem::directory_iterator it = createRIterator(p); ^ fsysclass.cpp:315:16: error: 'class boost::filesystem::directory_iterator' has no member named 'no_push' it.no_push(); ^ fsysclass.cpp:325:16: error: 'class boost::filesystem::directory_iterator' has no member named 'no_push' it.no_push(); ^ |
|
|
boost::filesystem::recursive_directory_iterator it(p);
no, because I DON'T KNOW WHAT THE HELL IS IN THAT FUNCTION. If I did not know this emplementation, why on earth would I know that? |
Can it still hit symlink directories though? |