Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. boost::filesystem::path p("E:"); //Will iterate only over local directory (E:\projects\iter\build)
  2. boost::filesystem::recursive_directory_iterator end_itr;
  3.  
  4. for(boost::filesystem::recursive_directory_iterator itr(p); itr != end_itr; ++itr) {
  5. boost::filesystem::path currentPath = itr->path();
  6.  
  7. .
  8. .
  9. .
  10.  
  11. ------
  12.  
  13. boost::filesystem::path p("E:\\"); //Will NOT iterate at all
  14. boost::filesystem::recursive_directory_iterator end_itr;
  15.  
  16. for(boost::filesystem::recursive_directory_iterator itr(p); itr != end_itr; ++itr) {
  17. boost::filesystem::path currentPath = itr->path();
  18.  
  19. .
  20. .
  21. .
  22.  
  23. ------
  24.  
  25. boost::filesystem::path p("E:\\some-dir"); //Will iterate without a problem
  26. boost::filesystem::recursive_directory_iterator end_itr;
  27.  
  28. for(boost::filesystem::recursive_directory_iterator itr(p); itr != end_itr; ++itr) {
  29. boost::filesystem::path currentPath = itr->path();
  30.  
  31. .
  32. .
  33. .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement