diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-04-09 17:40:13 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-04-09 17:40:13 +0800 |
| commit | 9750786a5c03b5ce3ea22b240d1b3cd34990856b (patch) | |
| tree | e495e43245e1bacc86d33142af202613a82a40c1 /src/3rdParty/efsw/FileInfo.cpp | |
| parent | 571fb952b99e580a0381f539885f8f175e2ec3b0 (diff) | |
| download | yuescript-9750786a5c03b5ce3ea22b240d1b3cd34990856b.tar.gz yuescript-9750786a5c03b5ce3ea22b240d1b3cd34990856b.tar.bz2 yuescript-9750786a5c03b5ce3ea22b240d1b3cd34990856b.zip | |
Updated efsw. Fixed issue #204.
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 |
