src/system/helpers.cpp: Add function readLink()

This commit is contained in:
M. Liebmann
2017-02-22 06:21:21 +01:00
parent 8bee8b4c6d
commit 0c182785e2
2 changed files with 11 additions and 0 deletions

View File

@@ -1272,3 +1272,13 @@ std::string Lang2ISO639_1(std::string& lang)
return ret;
}
string readLink(string lnk)
{
char buf[PATH_MAX];
memset(buf, 0, sizeof(buf)-1);
if (readlink(lnk.c_str(), buf, sizeof(buf)-1) != -1)
return (string)buf;
return "";
}