Changeset 46008 in vbox
- Timestamp:
- May 13, 2013 11:05:55 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85671
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dir.h
r44528 r46008 273 273 * systems (or Unixes) stores the type of a directory entry and instead 274 274 * expects the user to use stat() to get it. So, when you see this you 275 * should use RT PathQueryInfo to get the type, or if if you're lazy, use276 * RTDirReadEx. */275 * should use RTDirQueryUnknownType or RTDirQueryUnknownTypeEx to get the type, 276 * or if if you're lazy, use RTDirReadEx. */ 277 277 RTDIRENTRYTYPE enmType; 278 278 /** The length of the filename, excluding the terminating nul character. */ … … 285 285 /** Pointer to a directory entry. */ 286 286 typedef RTDIRENTRY *PRTDIRENTRY; 287 /** Pointer to a const directory entry. */ 288 typedef RTDIRENTRY const *PCRTDIRENTRY; 287 289 288 290 … … 314 316 /** Pointer to a directory entry. */ 315 317 typedef RTDIRENTRYEX *PRTDIRENTRYEX; 318 /** Pointer to a const directory entry. */ 319 typedef RTDIRENTRYEX const *PCRTDIRENTRYEX; 316 320 317 321 … … 410 414 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags); 411 415 416 /** 417 * Resolves RTDIRENTRYTYPE_UNKNOWN values returned by RTDirRead. 418 * 419 * @returns IPRT status code (see RTPathQueryInfo). 420 * @param pszComposedName The path to the directory entry. The caller must 421 * compose this, it's NOT sufficient to pass 422 * RTDIRENTRY::szName! 423 * @param penmType Pointer to the RTDIRENTRY::enmType member. If this 424 * is not RTDIRENTRYTYPE_UNKNOWN, the function will 425 * return immediately without doing anything. If it 426 * is, it will use RTPathQueryInfo to try figure out 427 * the correct value. On failure, this will be 428 * unchanged. 429 */ 430 RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, RTDIRENTRYTYPE *penmType); 431 432 /** 433 * Resolves RTDIRENTRYTYPE_UNKNOWN values returned by RTDirRead, extended 434 * version. 435 * 436 * @returns IPRT status code (see RTPathQueryInfo). 437 * @param pszComposedName The path to the directory entry. The caller must 438 * compose this, it's NOT sufficient to pass 439 * RTDIRENTRY::szName! 440 * @param penmType Pointer to the RTDIRENTRY::enmType member or 441 * similar. Will NOT be checked on input. 442 * @param pObjInfo The object info buffer to use with RTPathQueryInfo. 443 */ 444 RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, RTDIRENTRYTYPE *penmType, PRTFSOBJINFO pObjInfo); 445 446 /** 447 * Checks if the directory entry returned by RTDirRead is '.', '..' or similar. 448 * 449 * @returns true / false. 450 * @param pDirEntry The directory entry to check. 451 */ 452 RTDECL(bool) RTDirEntryIsStdDotLink(PRTDIRENTRY pDirEntry); 453 454 /** 455 * Checks if the directory entry returned by RTDirReadEx is '.', '..' or 456 * similar. 457 * 458 * @returns true / false. 459 * @param pDirEntryEx The extended directory entry to check. 460 */ 461 RTDECL(bool) RTDirEntryExIsStdDotLink(PCRTDIRENTRYEX pDirEntryEx); 412 462 413 463 /** -
trunk/include/iprt/mangling.h
r45994 r46008 426 426 # define RTDirCreateTempSecure RT_MANGLER(RTDirCreateTempSecure) 427 427 # define RTDirCreateUniqueNumbered RT_MANGLER(RTDirCreateUniqueNumbered) 428 # define RTDirEntryIsStdDotLink RT_MANGLER(RTDirEntryIsStdDotLink) 429 # define RTDirEntryExIsStdDotLink RT_MANGLER(RTDirEntryExIsStdDotLink) 428 430 # define RTDirExists RT_MANGLER(RTDirExists) 429 431 # define RTDirFlush RT_MANGLER(RTDirFlush) … … 432 434 # define RTDirOpenFiltered RT_MANGLER(RTDirOpenFiltered) 433 435 # define RTDirQueryInfo RT_MANGLER(RTDirQueryInfo) 436 # define RTDirQueryUnknownType RT_MANGLER(RTDirQueryUnknownType) 437 # define RTDirQueryUnknownTypeEx RT_MANGLER(RTDirQueryUnknownTypeEx) 434 438 # define RTDirRead RT_MANGLER(RTDirRead) 435 439 # define RTDirReadEx RT_MANGLER(RTDirReadEx) -
trunk/src/VBox/Runtime/r3/dir.cpp
r45630 r46008 731 731 } 732 732 733 734 RTDECL(int) RTDirQueryUnknownTypeEx(const char *pszComposedName, RTDIRENTRYTYPE *penmType, PRTFSOBJINFO pObjInfo) 735 { 736 int rc = RTPathQueryInfoEx(pszComposedName, pObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); 737 if (RT_FAILURE(rc)) 738 return rc; 739 740 if (RTFS_IS_DIRECTORY(pObjInfo->Attr.fMode)) 741 *penmType = RTDIRENTRYTYPE_DIRECTORY; 742 else if (RTFS_IS_FILE(pObjInfo->Attr.fMode)) 743 *penmType = RTDIRENTRYTYPE_FILE; 744 else if (RTFS_IS_SYMLINK(pObjInfo->Attr.fMode)) 745 *penmType = RTDIRENTRYTYPE_SYMLINK; 746 else if (RTFS_IS_FIFO(pObjInfo->Attr.fMode)) 747 *penmType = RTDIRENTRYTYPE_FIFO; 748 else if (RTFS_IS_DEV_CHAR(pObjInfo->Attr.fMode)) 749 *penmType = RTDIRENTRYTYPE_DEV_CHAR; 750 else if (RTFS_IS_DEV_BLOCK(pObjInfo->Attr.fMode)) 751 *penmType = RTDIRENTRYTYPE_DEV_BLOCK; 752 else if (RTFS_IS_SOCKET(pObjInfo->Attr.fMode)) 753 *penmType = RTDIRENTRYTYPE_SOCKET; 754 else if (RTFS_IS_WHITEOUT(pObjInfo->Attr.fMode)) 755 *penmType = RTDIRENTRYTYPE_WHITEOUT; 756 else 757 *penmType = RTDIRENTRYTYPE_UNKNOWN; 758 759 return VINF_SUCCESS; 760 } 761 762 763 RTDECL(int) RTDirQueryUnknownType(const char *pszComposedName, RTDIRENTRYTYPE *penmType) 764 { 765 if (*penmType != RTDIRENTRYTYPE_UNKNOWN) 766 return VINF_SUCCESS; 767 768 RTFSOBJINFO ObjInfo; 769 return RTDirQueryUnknownTypeEx(pszComposedName, penmType, &ObjInfo); 770 } 771 772 773 RTDECL(bool) RTDirEntryIsStdDotLink(PRTDIRENTRY pDirEntry) 774 { 775 if (pDirEntry->szName[0] != '.') 776 return false; 777 if (pDirEntry->cbName == 1) 778 return true; 779 if (pDirEntry->cbName != 2) 780 return false; 781 return pDirEntry->szName[1] == '.'; 782 } 783 784 785 RTDECL(bool) RTDirEntryExIsStdDotLink(PCRTDIRENTRYEX pDirEntryEx) 786 { 787 if (pDirEntryEx->szName[0] != '.') 788 return false; 789 if (pDirEntryEx->cbName == 1) 790 return true; 791 if (pDirEntryEx->cbName != 2) 792 return false; 793 return pDirEntryEx->szName[1] == '.'; 794 } 795 -
trunk/src/VBox/Runtime/r3/win/fs-win.cpp
r44528 r46008 320 320 pProperties->fSupportsUnicode = !!(dwFlags & FILE_UNICODE_ON_DISK); 321 321 pProperties->fCaseSensitive = false; /* win32 is case preserving only */ 322 /** @todo r=bird: What about FILE_CASE_SENSITIVE_SEARCH ? Is this set for NTFS 323 * as well perchance? If so, better mention it instead of just setting 324 * fCaseSensitive to false. */ 322 325 pProperties->fRemote = false; /* no idea yet */ 323 326 }
Note:
See TracChangeset
for help on using the changeset viewer.