id summary reporter owner description type status milestone component version severity resolution keywords cc 2260 Missing slash when iterating windows root path Lin Yi-Li Beman Dawes "A windows root path without backslash or slash, ex. ""C:"", will cause the result of directory_iterator missing a slash after ':'. For example, it will produce a broken path such as ""C:filename"". Here is a sample to produce this: {{{ #include #include #include using namespace boost::filesystem; int main() { const char *drive_to_search = ""C:""; std::cout.imbue( std::locale()); for( directory_iterator i( path( drive_to_search, native)), end; i != end; ++i) { std::cout << i->path() << std::endl; } return 0; } }}} By tracing the stack, I think the problem is function boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits>::m_append_separator_if_needed() won't append a slash in case of merging windows root path and filename. Here is the call stack starting at the constructor of directory_iterator. {{{ boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits>::m_append_separator_if_needed() boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits>::operator/=(const wchar_t *) boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits>::operator/=(const boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits> & rhs) boost::filesystem::operator/,std::allocator >,boost::filesystem::wpath_traits>(const boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits> & lhs, const std::basic_string,std::allocator > & rhs) boost::filesystem::basic_directory_iterator,std::allocator >,boost::filesystem::wpath_traits> >::m_init(const boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits> & dir_path) boost::filesystem::basic_directory_iterator,std::allocator >,boost::filesystem::wpath_traits> >::basic_directory_iterator,std::allocator >,boost::filesystem::wpath_traits> >(const boost::filesystem::basic_path,std::allocator >,boost::filesystem::wpath_traits> & dir_path) }}} " Bugs closed To Be Determined filesystem Boost 1.36.0 Problem invalid directory_iterator seperator