VirtualBox

Ignore:
Timestamp:
Aug 27, 2009 12:42:16 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: Added RTFileExists

File:
1 edited

Legend:

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

    r21616 r22516  
    9090
    9191
     92RTDECL(bool) RTFileExists(const char *pszPath)
     93{
     94    bool fRc = false;
     95    char *pszNativePath;
     96    int rc = rtPathToNative(&pszNativePath, pszPath);
     97    if (RT_SUCCESS(rc))
     98    {
     99        struct stat s;
     100        fRc = !stat(pszNativePath, &s)
     101            && S_ISREG(s.st_mode);
     102
     103        rtPathFreeNative(pszNativePath);
     104    }
     105
     106    LogFlow(("RTFileExists(%p={%s}): returns %RTbool\n", pszPath, pszPath, fRc));
     107    return fRc;
     108}
     109
     110
    92111RTR3DECL(int)  RTFileOpen(PRTFILE pFile, const char *pszFilename, unsigned fOpen)
    93112{
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