FAQ Database Discussion Community


Get an ordered list of files in a folder

c++,boost,boost-filesystem
I have used boost::filesystem::directory_iterator in order to get a list of all the available files into a given folder. The problem is that I supposed this method would give me the files in alphabetical order, while the results seem pretty random. Is there any fancy way of alphabetically sorting them?...

Boost filesystem iteration fails with a long path

c++,boost,visual-studio-2013,boost-filesystem
I'm trying to iterate into a folder using boost::filesystem, but when the path is too long (absolute path >95 chars), boost fail on iteration. Is some knows boost issue with this? Any idea to solve it? while (itr != boost::filesystem::recursive_directory_iterator()) { ++itr; } I'm using boost 1.57, and VS2013....

C++ Boost::filesystem::path with unicode characters

c++,boost,boost-filesystem
I am new to C++, need a little help here. I have three folders - one in English, one in Japanese and one in Russian for test purposes. When I run this little program #include <windows.h> #include <string> #include <iostream> #include <boost/filesystem.hpp> #include <boost/locale.hpp> using namespace boost::filesystem; using namespace std;...

Get modification time of locked folder with boost::filesystem::last_write_time

c++,boost,acl,boost-filesystem
When I'm using time_t t = last_write_time("C:\\System Volume Information"); I get the following exception: boost::filesystem::last_write_time: Access denied: "C:\System Volume Information" Nevertheless, Windows Explorer is able to get access to that information. It looks like Boost requires extra access to the folder, and that's the reason the code doesn't work. Is...