Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Use stat for all unknown file entries
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondLim committed Nov 2, 2013
1 parent 2666b03 commit 132dc1c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions appshell/appshell_extensions_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,13 @@ int32 ReadDir(ExtensionString path, CefRefPtr<CefListValue>& directoryContents)
resultDirs.push_back(ExtensionString(files->d_name));
else if(files->d_type==DT_REG)
resultFiles.push_back(ExtensionString(files->d_name));
else if (files->d_type==DT_UNKNOWN)
else
{
// Some Linux file systems do not support d_type.
// So we get DT_UNKNOWN on these file systems and
// we need to use stat call for each file entry to
// distinguish between files and directories.
// Some file systems do not support d_type we use
// for faster type detection. So on these file systems
// we may get DT_UNKNOWN for all file entries, but just
// to be safe we will use slower stat call for all
// file entries that are not DT_DIR or DT_REG.
curFile = path + files->d_name;
if(stat(curFile.c_str(), &statbuf) == -1)
continue;
Expand Down

0 comments on commit 132dc1c

Please sign in to comment.