VirtualBox

Changeset 31404 in vbox


Ignore:
Timestamp:
Aug 5, 2010 1:02:38 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64469
Message:

RTPathGetMode: Can simplify this now that we've got RTPathQueryInfoEx.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/path.h

    r28800 r31404  
    654654 * @param   pfMode      Where to store the file mode, see @ref grp_rt_fs for details.
    655655 *
    656  * @remark  This is wrapper around RTPathReal() + RTPathQueryInfo()
    657  *          and exists to complement RTPathSetMode().
     656 * @remark  This is wrapper around RTPathQueryInfoEx(RTPATH_F_FOLLOW_LINK) and
     657 *          exists to complement RTPathSetMode().
    658658 */
    659659RTR3DECL(int) RTPathGetMode(const char *pszPath, PRTFMODE pfMode);
  • trunk/src/VBox/Runtime/r3/path.cpp

    r31305 r31404  
    191191RTR3DECL(int) RTPathGetMode(const char *pszPath, PRTFMODE pfMode)
    192192{
    193     AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
    194193    AssertPtrReturn(pfMode, VERR_INVALID_POINTER);
    195194
    196     char szPathReal[RTPATH_MAX];
    197     int rc = RTPathReal(pszPath, szPathReal, sizeof(szPathReal));
     195    RTFSOBJINFO ObjInfo;
     196    rc = RTPathQueryInfoEx(pszPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
    198197    if (RT_SUCCESS(rc))
    199     {
    200         RTFSOBJINFO objInfo;
    201         rc = RTPathQueryInfo(szPathReal, &objInfo, RTFSOBJATTRADD_NOTHING);
    202         if (RT_SUCCESS(rc))
    203             *pfMode = objInfo.Attr.fMode;
    204     }
     198        *pfMode = ObjInfo.Attr.fMode;
    205199
    206200    return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette