VirtualBox

Changeset 3964 in vbox


Ignore:
Timestamp:
Aug 1, 2007 2:44:20 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23383
Message:

Deal with wildcard path parts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp

    r3961 r3964  
    4242#define Log(a)  printf a
    4343
    44 #define RTPathQueryInfo rtPathQueryInfo
     44#define RTPathQueryInfo     rtPathQueryInfo
     45#define RTDirOpenFiltered   rtDirOpenFiltered
     46#define RTDirClose          rtDirClose
     47#define RTDirReadEx         rtDirReadEx
    4548
    4649static int iDirList = 0;
     
    248251
    249252
    250 int testCase(char *pszFullPath)
     253int testCase(char *pszFullPath, bool fWildCard = false)
    251254{
    252255    int rc;
    253256    RTFSOBJINFO info;
     257    char *pszWildCardComponent = NULL;
     258
     259    if (fWildCard)
     260    {
     261        /* strip off the last path component, that contains the wildcard(s) */
     262        uint32_t len = strlen(pszFullPath);
     263        char    *src = pszFullPath + len - 1;
     264
     265        while(src > pszFullPath)
     266        {
     267            if (*src == RTPATH_DELIMITER)
     268                break;
     269            src--;
     270        }
     271        if (*src == RTPATH_DELIMITER)
     272        {
     273            pszWildCardComponent = src;
     274            *pszWildCardComponent = 0;
     275        }
     276    }
     277
    254278    rc = RTPathQueryInfo(pszFullPath, &info, RTFSOBJATTRADD_NOTHING);
    255279    if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND)
     
    328352
    329353    }
     354    if (fWildCard)
     355    {
     356        Assert(pszWildCardComponent);
     357        *pszWildCardComponent = RTPATH_DELIMITER;
     358    }
    330359
    331360    if (VBOX_SUCCESS(rc))
     
    349378    strcpy(szTest, "c:\\TEST dir\\subDiR\\aTestje.baT");
    350379    testCase(szTest);
     380    _asm int 3;
     381    strcpy(szTest, "c:\\TEST dir\\subDiR\\*");
     382    testCase(szTest, true);
    351383    return 0;
    352384}
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