-#endif // !VMS6.x or earlier
-
- return result;
-}
-
-wxString wxFindNextFile()
-{
- wxString result;
-
-#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
- wxCHECK_MSG( gs_dirStream, result, wxT("must call wxFindFirstFile first") );
-
- // Find path only so we can concatenate
- // found file onto path
- wxString path(wxPathOnly(gs_strFileSpec));
- wxString name(wxFileNameFromPath(gs_strFileSpec));
-
- /* MATTHEW: special case: path is really "/" */
- if ( !path && gs_strFileSpec[0u] == wxT('/'))
- path = wxT('/');
-
- // Do the reading
- struct dirent *nextDir;
- for ( nextDir = readdir(gs_dirStream);
- nextDir != NULL;
- nextDir = readdir(gs_dirStream) )
- {
- if (wxMatchWild(name, nextDir->d_name, FALSE) && // RR: added FALSE to find hidden files
- strcmp(nextDir->d_name, ".") &&
- strcmp(nextDir->d_name, "..") )
- {
- result.Empty();
- if ( !path.IsEmpty() )
- {
- result = path;
- if ( path != wxT('/') )
- result += wxT('/');
- }
-
- result += nextDir->d_name;
-
- // Only return "." and ".." when they match
- bool isdir;
- if ( (strcmp(nextDir->d_name, ".") == 0) ||
- (strcmp(nextDir->d_name, "..") == 0))
- {
- if ( (gs_findFlags & wxDIR) != 0 )
- isdir = TRUE;
- else
- continue;
- }
- else
- isdir = wxDirExists(result);
-
- // and only return directories when flags & wxDIR
- if ( !gs_findFlags ||
- ((gs_findFlags & wxDIR) && isdir) ||
- ((gs_findFlags & wxFILE) && !isdir) )
- {
- return result;
- }
- }
- }
-
- result.Empty(); // not found
-
- closedir(gs_dirStream);
- gs_dirStream = (DIR *) NULL;
-#endif // !VMS6.2 or earlier
-
- return result;
-}
-
-#elif defined(__WXMAC__)
-
-struct MacDirectoryIterator
-{
- CInfoPBRec m_CPB ;
- wxInt16 m_index ;
- long m_dirId ;
- Str255 m_name ;
-} ;
-
-static int g_iter_flags ;
-
-static MacDirectoryIterator g_iter ;
-wxString g_iter_spec ;
-
-wxString wxFindFirstFile(const wxChar *spec, int flags)
-{
- wxString result;
-
- g_iter_spec = spec ;
- g_iter_spec.MakeUpper() ;
- g_iter_flags = flags; /* MATTHEW: [5] Remember flags */
-
- // Find path only so we can concatenate found file onto path
- wxString path(wxPathOnly(spec));
- FSSpec fsspec ;
-
- wxMacFilename2FSSpec( path , &fsspec ) ;
- g_iter.m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
- g_iter.m_CPB.hFileInfo.ioNamePtr = g_iter.m_name ;
- g_iter.m_index = 0 ;
-
- Boolean isDir ;
- FSpGetDirectoryID( &fsspec , &g_iter.m_dirId , &isDir ) ;
- if ( !isDir )
- return wxEmptyString ;
-
- return wxFindNextFile( ) ;
-}
-
-wxString wxFindNextFile()
-{
- wxString result;
-
- short err = noErr ;
- wxString name ;