VirtualBox

Changeset 23298 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Sep 24, 2009 4:38:05 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52791
Message:

RTDirExists: Added a generic implementation for use on Window because GetFileAttributesEx doesn't do what we like it to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r20111 r23298  
    5252
    5353
    54 RTDECL(bool) RTDirExists(const char *pszPath)
    55 {
    56     bool fRc = false;
    57 
    58     /*
    59      * Convert to UTF-16.
    60      */
    61     PRTUTF16 pwszString;
    62     int rc = RTStrToUtf16(pszPath, &pwszString);
    63     AssertRC(rc);
    64     if (RT_SUCCESS(rc))
    65     {
    66         /*
    67          * Query and check attributes.
    68          */
    69         DWORD dwAttr = GetFileAttributesW((LPCWSTR)pwszString);
    70         fRc = dwAttr != INVALID_FILE_ATTRIBUTES
    71             && (dwAttr & FILE_ATTRIBUTE_DIRECTORY);
    72 
    73         RTUtf16Free(pwszString);
    74     }
    75 
    76     LogFlow(("RTDirExists(%p:{%s}): returns %RTbool\n", pszPath, pszPath, fRc));
    77     return fRc;
    78 }
    79 
    80 
    8154RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode)
    8255{
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