File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,19 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
118118    }
119119    else 
120120    {
121+         #if  __APPLE__  // #1395 
122+         struct  stat  fileStat ;
123+         if (stat (path , & fileStat ) !=  0 )
124+             return  false;
125+ 
126+         unsigned int   mode  =  fileStat .st_mode  &  S_IFMT ;
127+ 
128+         if (pathType  &  FF_PATHTYPE_FILE  &&  mode  !=  S_IFDIR )
129+             return  true;
130+ 
131+         if (pathType  &  FF_PATHTYPE_DIRECTORY  &&  mode  ==  S_IFDIR )
132+             return  true;
133+         #else 
121134        size_t  len  =  strlen (path );
122135        assert (len  <  PATH_MAX );
123136        if  (len  ==  0 ) return  false;
@@ -134,6 +147,7 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
134147        else 
135148            ret  =  access (path , F_OK );
136149        return  pathType  ==  FF_PATHTYPE_DIRECTORY  ? ret  ==  0  : ret  ==  -1  &&  errno  ==  ENOTDIR ;
150+         #endif 
137151    }
138152
139153    #endif 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments