summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
committerB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
commitf76994f1fb3e25c4563c9d8afce6bbc86701d1d2 (patch)
treeb39389163603195a0169af57712eb0765e5c11f4 /zen/symlink_target.h
parentadd upstream 12.3 (diff)
downloadFreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.tar.gz
FreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.tar.bz2
FreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.zip
add upstream 12.412.4
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index 083360af..8580a9dd 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -8,6 +8,7 @@
#define SYMLINK_TARGET_H_801783470198357483
#include "file_error.h"
+#include "file_path.h"
#include <unistd.h>
#include <stdlib.h> //realpath
@@ -35,12 +36,14 @@ Zstring getSymlinkResolvedPath(const Zstring& linkPath); //throw FileError
//################################ implementation ################################
+
+namespace zen
+{
namespace
{
//retrieve raw target data of symlink or junction
-zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //throw SysError
+SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //throw SysError
{
- using namespace zen;
const size_t bufSize = 10000;
std::vector<char> buf(bufSize);
@@ -54,9 +57,8 @@ zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //thro
}
-Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw SysError
+Zstring getSymlinkResolvedPath_impl(const Zstring& linkPath) //throw SysError
{
- using namespace zen;
char* targetPath = ::realpath(linkPath.c_str(), nullptr);
if (!targetPath)
THROW_LAST_SYS_ERROR("realpath");
@@ -66,8 +68,6 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw SysError
}
-namespace zen
-{
inline
SymlinkRawContent getSymlinkRawContent(const Zstring& linkPath)
{
@@ -84,7 +84,7 @@ Zstring getSymlinkResolvedPath(const Zstring& linkPath)
{
try
{
- return getResolvedSymlinkPath_impl(linkPath); //throw SysError
+ return getSymlinkResolvedPath_impl(linkPath); //throw SysError
}
catch (const SysError& e) { throw FileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), e.toString()); }
}
bgstack15