diff options
Diffstat (limited to 'src/3rdParty/efsw/FileInfo.cpp')
-rw-r--r--[-rwxr-xr-x] | src/3rdParty/efsw/FileInfo.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/3rdParty/efsw/FileInfo.cpp b/src/3rdParty/efsw/FileInfo.cpp index 072cd6d..707f617 100755..100644 --- a/src/3rdParty/efsw/FileInfo.cpp +++ b/src/3rdParty/efsw/FileInfo.cpp | |||
@@ -35,10 +35,6 @@ | |||
35 | #endif | 35 | #endif |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32 | ||
39 | #include <filesystem> | ||
40 | #endif | ||
41 | |||
42 | namespace efsw { | 38 | namespace efsw { |
43 | 39 | ||
44 | bool FileInfo::exists( const std::string& filePath ) { | 40 | bool FileInfo::exists( const std::string& filePath ) { |
@@ -186,12 +182,14 @@ bool FileInfo::isLink() const { | |||
186 | std::string FileInfo::linksTo() { | 182 | std::string FileInfo::linksTo() { |
187 | #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32 | 183 | #if EFSW_PLATFORM != EFSW_PLATFORM_WIN32 |
188 | if ( isLink() ) { | 184 | if ( isLink() ) { |
189 | std::error_code ec; | 185 | char* ch = realpath( Filepath.c_str(), NULL ); |
190 | auto ch = std::filesystem::canonical( Filepath, ec ); | 186 | |
187 | if ( NULL != ch ) { | ||
188 | std::string tstr( ch ); | ||
191 | 189 | ||
192 | if ( !ec ) { | 190 | free( ch ); |
193 | 191 | ||
194 | return ch.string(); | 192 | return tstr; |
195 | } | 193 | } |
196 | } | 194 | } |
197 | #endif | 195 | #endif |