Portability - Solaris
- Added a SOLARIS workaround for the lack of de_type member in struct dirent that other OSes have.
This commit is contained in:
@@ -121,10 +121,19 @@ void Directory::list (
|
||||
!strcmp (de->d_name, ".."))
|
||||
continue;
|
||||
|
||||
#ifdef SOLARIS
|
||||
struct stat s;
|
||||
stat (de->d_name, &s);
|
||||
if (recursive && s.st_mode & S_IFDIR)
|
||||
list (base + "/" + de->d_name, results, recursive);
|
||||
else
|
||||
results.push_back (base + "/" + de->d_name);
|
||||
#else
|
||||
if (recursive && de->d_type == DT_DIR)
|
||||
list (base + "/" + de->d_name, results, recursive);
|
||||
else
|
||||
results.push_back (base + "/" + de->d_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
closedir (dp);
|
||||
|
||||
Reference in New Issue
Block a user