From 9750786a5c03b5ce3ea22b240d1b3cd34990856b Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 9 Apr 2025 17:40:13 +0800 Subject: Updated efsw. Fixed issue #204. --- src/3rdParty/efsw/FileInfo.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) mode change 100755 => 100644 src/3rdParty/efsw/FileInfo.cpp (limited to 'src/3rdParty/efsw/FileInfo.cpp') diff --git a/src/3rdParty/efsw/FileInfo.cpp b/src/3rdParty/efsw/FileInfo.cpp old mode 100755 new mode 100644 index 072cd6d..707f617 --- a/src/3rdParty/efsw/FileInfo.cpp +++ b/src/3rdParty/efsw/FileInfo.cpp @@ -35,10 +35,6 @@ #endif #endif -#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32 -#include -#endif - namespace efsw { bool FileInfo::exists( const std::string& filePath ) { @@ -186,12 +182,14 @@ bool FileInfo::isLink() const { std::string FileInfo::linksTo() { #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32 if ( isLink() ) { - std::error_code ec; - auto ch = std::filesystem::canonical( Filepath, ec ); + char* ch = realpath( Filepath.c_str(), NULL ); + + if ( NULL != ch ) { + std::string tstr( ch ); - if ( !ec ) { + free( ch ); - return ch.string(); + return tstr; } } #endif -- cgit v1.2.3-55-g6feb