← Back to team overview

kicad-developers team mailing list archive

[PATCH 2/2] Make file test more portable

 

---
 3d-viewer/3d_cache/3d_cache.cpp | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp
index e69d923..697ac5e 100644
--- a/3d-viewer/3d_cache/3d_cache.cpp
+++ b/3d-viewer/3d_cache/3d_cache.cpp
@@ -514,13 +514,7 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
 
     if( wxFileName::Exists( fname ) )
     {
-        // determine if the file is a regular file
-        struct stat info;
-
-        if( stat( fname.ToUTF8(), &info ) )
-            return false;
-
-        if( !S_ISREG( info.st_mode ) )
+        if( !wxFileName::FileExists( fname ) )
         {
             wxString errmsg = _( "path exists but is not a regular file" );
             wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'\n", errmsg.ToUTF8(),

References