Below function read directory and insert files name (by push_back()) into vector
#include <dirent.h>
void open(string path){
DIR* dir;
dirent *pdir;
dir = opendir(path.c_str());
while (pdir = readdir(dir)){
vectorForResults.push_back(pdir->d_name);
}
}
Question: How can I check size of each file (from current directiory) using boots library?
I found method described on http://en.highscore.de/cpp/boost/filesystem.html
It's e.g.:
boost::filesystem::path p("C:\\Windows\\win.ini");
std::cout << boost::filesystem::file_size(p) << std::endl;
Could someone please help how to implement boost it in my open() function? Especially how to assign current directory path name into variable p and then iterate through files names.