boost::filesystem BUG !! (Windows XP)
Hi all, Input : dir_path \code boost::filesystem::path p(dir_path, boost::filesystem::native); boost::filesystem::directory_iterator i(p), j; while (i != j) { std::cout << i->string(); // Output ++i; } \endcode On Windows XP, If input dir_path is "d:\" , the i->string() returns complete path of all files and directories. BUT, If input dir_path is "d:" , the i->string() returns relative path of all files and directories. Please check if this is desired behaviour or not !! thanks saurabh
"Saurabh Sood"
Hi all,
Input : dir_path \code boost::filesystem::path p(dir_path, boost::filesystem::native); boost::filesystem::directory_iterator i(p), j; while (i != j) { std::cout << i->string(); // Output ++i; } \endcode
On Windows XP, If input dir_path is "d:\" , the i->string() returns complete path of all files and directories. BUT, If input dir_path is "d:" , the i->string() returns relative path of all files and directories.
Please check if this is desired behaviour or not !!
That is the expected behavior. It isn't a bug. If a complete path is desired, one can be created via the complete() or system_complete() functions. HTH, --Beman
participants (2)
-
Beman Dawes
-
Saurabh Sood