Lines Matching defs:szMapPath

196     char szMapPath[RTPATH_MAX];
197 int rc = RTPathJoin(szMapPath, sizeof(szMapPath) - sizeof("/xxxx/yyyy/xxxx/yyyy/xxxx/zzzzzzzzzzzz") + 1,
202 size_t cch = strlen(szMapPath);
203 szMapPath[cch] = '-';
205 rc = RTUuidToStr(pFileUuid, &szMapPath[cch + 2], sizeof(szMapPath) - cch);
210 RTStrToUpper(&szMapPath[cch + 2]);
213 szMapPath[cch + 1] = szMapPath[cch + 2];
214 szMapPath[cch + 2] = szMapPath[cch + 3];
215 szMapPath[cch + 3] = szMapPath[cch + 4];
216 szMapPath[cch + 4] = szMapPath[cch + 5];
217 szMapPath[cch + 5] = '-';
225 Assert(szMapPath[cch] == '-');
226 szMapPath[cch] = '\0';
227 if (!RTDirExists(szMapPath))
229 rc = RTDirCreate(szMapPath, 0755, RTDIRCREATE_FLAGS_NOT_CONTENT_INDEXED_NOT_CRITICAL);
231 return RTMsgErrorRc(rc, "RTDirCreate failed on '%s' (UUID map path): %Rrc", szMapPath, rc);
233 szMapPath[cch] = RTPATH_SLASH;
241 //szMapPath[cch] = '\0';
242 rc = RTPathCalcRelative(szLinkTarget, sizeof(szLinkTarget), szMapPath, pszCacheFile);
243 //szMapPath[cch] = RTPATH_SLASH;
245 return RTMsgErrorRc(rc, "Failed to calculate relative path from '%s' to '%s': %Rrc", szMapPath, pszCacheFile, rc);
252 rc = RTPathQueryInfoEx(szMapPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
257 rc = RTPathQueryInfoEx(szMapPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
261 rc = RTSymlinkReadA(szMapPath, &pszCurTarget);
263 return RTMsgErrorRc(rc, "UUID map: failed to read existing symlink '%s': %Rrc", szMapPath, rc);
265 RTMsgInfo("UUID map: existing link '%s' has the same target ('%s').", szMapPath, pszCurTarget);
269 szMapPath, pszCurTarget, szLinkTarget);
276 RTMsgInfo("UUID map: replacing dangling link '%s'", szMapPath);
277 RTSymlinkDelete(szMapPath, 0 /*fFlags*/);
281 "UUID map: found file at '%s', expect symbolic link or nothing.", szMapPath);
284 "UUID map: found directory at '%s', expect symbolic link or nothing.", szMapPath);
288 szMapPath, ObjInfo.Attr.fMode);
294 rc = RTSymlinkCreate(szMapPath, szLinkTarget, RTSYMLINKTYPE_FILE, 0);
296 return RTMsgErrorRc(rc, "Failed to create UUID map symlink '%s' to '%s': %Rrc", szMapPath, szLinkTarget, rc);
297 RTMsgInfo("UUID map: %s => %s", szMapPath, szLinkTarget);