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