+#elif defined(__WXPM__)
+
+wxString wxFindFirstFile(const wxChar *spec, int flags)
+{
+ wxString result;
+
+ /*
+ // TODO: figure something out here for OS/2
+ gs_strFileSpec = spec;
+ gs_findFlags = flags;
+
+ // Find path only so we can concatenate found file onto path
+ wxString path(wxPathOnly(gs_strFileSpec));
+ if ( !path.IsEmpty() )
+ result << path << wxT('\\');
+
+ int flag = _A_NORMAL;
+ if (flags & wxDIR)
+ flag = _A_SUBDIR;
+
+ if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
+ {
+ char attrib;
+ attrib = gs_findDataStruct.attrib;
+
+ if (attrib & _A_SUBDIR) {
+ if (!(gs_findFlags & wxDIR))
+ return wxFindNextFile();
+ } else if (gs_findFlags && !(gs_findFlags & wxFILE))
+ return wxFindNextFile();
+
+ result += gs_findDataStruct.name;
+ }
+ */
+ return result;
+}
+
+wxString wxFindNextFile()
+{
+ wxString result;
+ // TODO:
+ return result;
+}
+
+#else // generic implementation:
+
+static wxDir *gs_dir = NULL;
+static wxString gs_dirPath;
+
+wxString wxFindFirstFile(const wxChar *spec, int flags)
+{
+ gs_dirPath = wxPathOnly(spec);
+ if ( gs_dirPath.IsEmpty() )
+ gs_dirPath = wxT(".");
+ if ( gs_dirPath.Last() != wxFILE_SEP_PATH )
+ gs_dirPath << wxFILE_SEP_PATH;
+
+ if (gs_dir)
+ delete gs_dir;
+ gs_dir = new wxDir(gs_dirPath);
+
+ if ( !gs_dir->IsOpened() )
+ {
+ wxLogSysError(_("Can not enumerate files '%s'"), spec);
+ return wxEmptyString;
+ }
+
+ int dirFlags = 0;
+ switch (flags)
+ {
+ case wxDIR: dirFlags = wxDIR_DIRS; break;
+ case wxFILE: dirFlags = wxDIR_FILES; break;
+ default: dirFlags = wxDIR_DIRS | wxDIR_FILES; break;
+ }
+
+ wxString result;
+ gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags);
+ if ( result.IsEmpty() )
+ wxDELETE(gs_dir);
+
+ return gs_dirPath + result;
+}
+
+wxString wxFindNextFile()
+{
+ wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") );
+
+ wxString result;
+ gs_dir->GetNext(&result);
+
+ if ( result.IsEmpty() )
+ wxDELETE(gs_dir);
+
+ return gs_dirPath + result;
+}
+
+#endif // Unix/Windows/OS/2