if ( err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES )
{
- wxLogSysError(err, wxString(_("Can not enumerate files in directory '%s'")),
+ wxLogSysError(err, _("Can not enumerate files in directory '%s'"),
m_dirname.c_str());
}
#endif // __WIN32__
bool wxDir::Open(const wxString& dirname)
{
delete M_DIR;
- m_data = new wxDirData(dirname);
+
+ // The Unix code does a similar test
+ if (wxDirExists(dirname))
+ {
+ m_data = new wxDirData(dirname);
- return true;
+ return true;
+ }
+ else
+ {
+ m_data = NULL;
+
+ return false;
+ }
}
bool wxDir::IsOpened() const