VirtualBox

Changeset 55612 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
May 3, 2015 2:09:03 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99985
Message:

VBoxSErviceToolboxStat: Implemented the -L option while checking the code for how it actually did the symlink stuff. 3 lines of code and feeding a variable to the IPRT function instead of a constant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp

    r44863 r55612  
    15201520    bool fVerbose = false;
    15211521    uint32_t fOutputFlags = VBOXSERVICETOOLBOXOUTPUTFLAG_LONG; /* Use long mode by default. */
     1522    uint32_t fQueryInfoFlags = RTPATH_F_ON_LINK;
    15221523
    15231524    /* Init file list. */
     
    15321533        {
    15331534            case 'f':
    1534             case 'L':
    15351535                RTMsgError("Sorry, option '%s' is not implemented yet!\n", ValueUnion.pDef->pszLong);
    15361536                rc = VERR_INVALID_PARAMETER;
     1537                break;
     1538
     1539            case 'L':
     1540                fQueryInfoFlags &= ~RTPATH_F_ON_LINK;
     1541                fQueryInfoFlags |= RTPATH_F_FOLLOW_LINK;
    15371542                break;
    15381543
     
    15561561            case VINF_GETOPT_NOT_OPTION:
    15571562                {
     1563/** @todo r=bird: The whole fileList is unecessary because you're using
     1564 * RTGETOPTINIT_FLAGS_OPTS_FIRST.  You can obviously do the processing right
     1565 * here, but you could also just drop down and rewind GetState.iNext by one and
     1566 * continue there. */
     1567
    15581568                    /* Add file(s) to buffer. This enables processing multiple files
    15591569                     * at once.
     
    15851595        {
    15861596            RTFSOBJINFO objInfo;
    1587             int rc2 = RTPathQueryInfoEx(pNodeIt->pszName, &objInfo,
    1588                                         RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK /* @todo Follow link? */);
     1597            int rc2 = RTPathQueryInfoEx(pNodeIt->pszName, &objInfo, RTFSOBJATTRADD_UNIX, fQueryInfoFlags);
    15891598            if (RT_FAILURE(rc2))
    15901599            {
     1600/** @todo r=bird: You can get a number of other errors here, like access denied. */
    15911601                if (!(fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE))
    1592                     RTMsgError("Cannot stat for '%s': No such file or directory\n",
    1593                                pNodeIt->pszName);
     1602                    RTMsgError("Cannot stat for '%s': No such file or directory (%Rrc)\n",
     1603                               pNodeIt->pszName, rc);
    15941604                rc = VERR_FILE_NOT_FOUND;
    15951605                /* Do not break here -- process every element in the list
Note: See TracChangeset for help on using the changeset viewer.

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