VirtualBox

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


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

IPRT: r52791 repated for RTFileExists.

File:
1 edited

Legend:

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

    r23047 r23302  
    126126
    127127    return fIsBeyondLimit;
    128 }
    129 
    130 
    131 RTDECL(bool) RTFileExists(const char *pszPath)
    132 {
    133     bool fRc = false;
    134 
    135     /*
    136      * Convert to UTF-16.
    137      */
    138     PRTUTF16 pwszString;
    139     int rc = RTStrToUtf16(pszPath, &pwszString);
    140     AssertRC(rc);
    141     if (RT_SUCCESS(rc))
    142     {
    143         /*
    144          * Query and check attributes.
    145          */
    146         DWORD dwAttr = GetFileAttributesW((LPCWSTR)pwszString);
    147         fRc = dwAttr != INVALID_FILE_ATTRIBUTES
    148             && !(dwAttr & (  FILE_ATTRIBUTE_DIRECTORY
    149                            | FILE_ATTRIBUTE_DEVICE
    150                            | FILE_ATTRIBUTE_REPARSE_POINT));
    151         RTUtf16Free(pwszString);
    152     }
    153 
    154     LogFlow(("RTFileExists(%p:{%s}): returns %RTbool\n", pszPath, pszPath, fRc));
    155     return fRc;
    156128}
    157129
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