path-win32.cpp revision a595bebfc109f595e64e843f8faf9cfb97f35564
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * innotek Portable Runtime - Path manipulation.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright (C) 2006-2007 innotek GmbH
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * available from http://www.virtualbox.org. This file is free software;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * General Public License as published by the Free Software Foundation,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Header Files *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Get the real (no symlinks, no . or .. components) path, must exist.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @returns iprt status code.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param pszPath The path to resolve.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param pszRealPath Where to store the real path.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param cchRealPath Size of the buffer.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncRTDECL(int) RTPathReal(const char *pszPath, char *pszRealPath, unsigned cchRealPath)
return (rc);
else if (rc <= 0)
return rc;
return (rc);
else if (rc <= 0)
return rc;
if (!g_szrtProgramPath[0])
return VINF_SUCCESS;
return VERR_BUFFER_OVERFLOW;
return VERR_PATH_NOT_FOUND;
return VERR_PATH_NOT_FOUND;
RTR3DECL(int) RTPathQueryInfo(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
if (!pszPath)
return VERR_INVALID_PARAMETER;
if (!pObjInfo)
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
#ifndef RT_DONT_CONVERT_FILENAMES
return rc;
return rc;
pObjInfo->Attr.fMode = rtFsModeFromDos((Data.dwFileAttributes << RTFS_DOS_SHIFT) & RTFS_DOS_MASK_NT,
switch (enmAdditionalAttribs)
case RTFSOBJATTRADD_EASIZE:
case RTFSOBJATTRADD_UNIX:
case RTFSOBJATTRADD_NOTHING:
return VERR_INTERNAL_ERROR;
return VINF_SUCCESS;
RTR3DECL(int) RTPathSetTimes(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
AssertMsgReturn(!pAccessTime || VALID_PTR(pAccessTime), ("%p\n", pAccessTime), VERR_INVALID_POINTER);
AssertMsgReturn(!pModificationTime || VALID_PTR(pModificationTime), ("%p\n", pModificationTime), VERR_INVALID_POINTER);
AssertMsgReturn(!pChangeTime || VALID_PTR(pChangeTime), ("%p\n", pChangeTime), VERR_INVALID_POINTER);
NULL);
if (pBirthTime)
if (pAccessTime)
if (pModificationTime)
LogFlow(("RTPathSetTimes(%p:{%s}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}): return %Rrc\n",
return rc;
int rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType)
if (fFileType)
return rc;
AssertMsgReturn(!(fRename & ~RTPATHRENAME_FLAGS_REPLACE), ("%#x\n", fRename), VERR_INVALID_PARAMETER);
int rc = rtPathWin32MoveRename(pszSrc, pszDst, fRename & RTPATHRENAME_FLAGS_REPLACE ? MOVEFILE_REPLACE_EXISTING : 0, 0);
LogFlow(("RTPathRename(%p:{%s}, %p:{%s}, %#x): returns %Rrc\n", pszSrc, pszSrc, pszDst, pszDst, fRename, rc));
return rc;
#ifndef RT_DONT_CONVERT_FILENAMES