boost::filesystem bug for win98
Hello, The windows implementation for find_first_file is flawed for windows 98. The problem is appending \* to the dir path: this is not supported for win98. Here is a possible fix that has been working for me quite well. inline const char * find_first_file( const char * dir, BOOST_HANDLE & handle, BOOST_SYSTEM_DIRECTORY_TYPE & data ) { // std::cout << "find_first_file " << dir << std::endl; // \* is not supported on win98 //std::string dirpath( std::string(dir) + "\\*" ); std::string dirpath( dir ); dirpath += ( dirpath.empty() || dirpath[dirpath.size()-1] != '\\' ) ? "\\*" : "*"; return ( (handle = ::FindFirstFileA( dirpath.c_str(), &data )) == BOOST_INVALID_HANDLE_VALUE ) ? 0 : data.cFileName; } -- Best regards, Sebastien mailto:smartel@real.com
At 07:58 PM 3/15/2005, Sebastien Martel wrote:
Hello,
The windows implementation for find_first_file is flawed for windows 98. The problem is appending \* to the dir path: this is not supported for win98.
Here is a possible fix that has been working for me quite well.
inline const char * find_first_file( const char * dir, BOOST_HANDLE & handle, BOOST_SYSTEM_DIRECTORY_TYPE & data ) { // std::cout << "find_first_file " << dir << std::endl;
// \* is not supported on win98 //std::string dirpath( std::string(dir) + "\\*" );
std::string dirpath( dir ); dirpath += ( dirpath.empty() || dirpath[dirpath.size()-1] != '\\' ) ? "\\*" : "*";
return ( (handle = ::FindFirstFileA( dirpath.c_str(), &data )) == BOOST_INVALID_HANDLE_VALUE ) ? 0 : data.cFileName; }
OK, fixed in CVS for both HEAD and i18n branch. Sorry for the delay. --Beman
participants (2)
-
Beman Dawes
-
Sebastien Martel