|
a/src/upmpdutils.cxx |
|
b/src/upmpdutils.cxx |
|
... |
|
... |
139 |
path_catslash(res);
|
139 |
path_catslash(res);
|
140 |
res += s2;
|
140 |
res += s2;
|
141 |
return res;
|
141 |
return res;
|
142 |
}
|
142 |
}
|
143 |
|
143 |
|
|
|
144 |
bool path_exists(const string& path)
|
|
|
145 |
{
|
|
|
146 |
return access(path.c_str(), 0) == 0;
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
bool path_isabsolute(const string &path)
|
|
|
150 |
{
|
|
|
151 |
if (!path.empty() && (path[0] == '/'
|
|
|
152 |
#ifdef _WIN32
|
|
|
153 |
|| path_isdriveabs(path)
|
|
|
154 |
#endif
|
|
|
155 |
)) {
|
|
|
156 |
return true;
|
|
|
157 |
}
|
|
|
158 |
return false;
|
|
|
159 |
}
|
|
|
160 |
|
144 |
string path_home()
|
161 |
string path_home()
|
145 |
{
|
162 |
{
|
146 |
uid_t uid = getuid();
|
163 |
uid_t uid = getuid();
|
147 |
|
164 |
|
148 |
struct passwd *entry = getpwuid(uid);
|
165 |
struct passwd *entry = getpwuid(uid);
|