Changeset 23291 in vbox for trunk/include/iprt
- Timestamp:
- Sep 24, 2009 4:08:19 PM (15 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r22722 r23291 710 710 /** Too many symbolic links. */ 711 711 #define VERR_TOO_MANY_SYMLINKS (-156) 712 /** The OS does not support setting the time stamps on a symbolic link. */ 713 #define VERR_NS_SYMLINK_SET_TIME (-157) 712 714 /** @} */ 713 715 -
trunk/include/iprt/path.h
r22109 r23291 118 118 119 119 120 /** @name Generic RTPath flags 121 * @{ */ 122 /** Last component: Work on the link. */ 123 #define RTPATH_F_ON_LINK RT_BIT_32(0) 124 /** Last component: Follow if link. */ 125 #define RTPATH_F_FOLLOW_LINK RT_BIT_32(1) 126 /** @} */ 127 128 129 /** Validates a flags parameter containing RTPATH_F_*. 130 * @remarks The parameters will be referneced multiple times. */ 131 #define RTPATH_F_IS_VALID(fFlags, fIgnore) \ 132 ( ((fFlags) & ~(uint32_t)(fIgnore)) == RTPATH_F_ON_LINK \ 133 || ((fFlags) & ~(uint32_t)(fIgnore)) == RTPATH_F_FOLLOW_LINK ) 134 135 120 136 /** 121 137 * Checks if the path exists. 122 138 * 123 * Symbolic links will all be attempted resolved .139 * Symbolic links will all be attempted resolved and broken links means false. 124 140 * 125 141 * @returns true if it exists and false if it doesn't. … … 127 143 */ 128 144 RTDECL(bool) RTPathExists(const char *pszPath); 145 146 /** 147 * Checks if the path exists. 148 * 149 * @returns true if it exists and false if it doesn't. 150 * @param pszPath The path to check. 151 * @param fFlags RTPATH_F_ON_LINK or RPATH_F_FOLLOW_LINK. 152 */ 153 RTDECL(bool) RTPathExistsEx(const char *pszPath, uint32_t fFlags); 129 154 130 155 /** … … 500 525 * Query information about a file system object. 501 526 * 502 * This API will not resolve symbolic links in the last component (just 503 * like unix lstat()). 504 * 505 * @returns VINF_SUCCESS if the object exists, information returned. 506 * @returns VERR_PATH_NOT_FOUND if any but the last component in the specified 527 * This API will resolve NOT symbolic links in the last component (just like 528 * unix lstat()). 529 * 530 * @returns IPRT status code. 531 * @retval VINF_SUCCESS if the object exists, information returned. 532 * @retval VERR_PATH_NOT_FOUND if any but the last component in the specified 507 533 * path was not found or was not a directory. 508 * @ret urnsVERR_FILE_NOT_FOUND if the object does not exist (but path to the534 * @retval VERR_FILE_NOT_FOUND if the object does not exist (but path to the 509 535 * parent directory exists). 510 * @returns some other iprt status code.511 536 * 512 537 * @param pszPath Path to the file system object. … … 519 544 520 545 /** 546 * Query information about a file system object. 547 * 548 * @returns IPRT status code. 549 * @retval VINF_SUCCESS if the object exists, information returned. 550 * @retval VERR_PATH_NOT_FOUND if any but the last component in the specified 551 * path was not found or was not a directory. 552 * @retval VERR_FILE_NOT_FOUND if the object does not exist (but path to the 553 * parent directory exists). 554 * 555 * @param pszPath Path to the file system object. 556 * @param pObjInfo Object information structure to be filled on successful return. 557 * @param enmAdditionalAttribs 558 * Which set of additional attributes to request. 559 * Use RTFSOBJATTRADD_NOTHING if this doesn't matter. 560 * @param fFlags RTPATH_F_ON_LINK or RPATH_F_FOLLOW_LINK. 561 */ 562 RTR3DECL(int) RTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags); 563 564 /** 521 565 * Changes the mode flags of a file system object. 522 566 * … … 573 617 574 618 /** 619 * Changes one or more of the timestamps associated of file system object. 620 * 621 * @returns iprt status code. 622 * @param pszPath Path to the file system object. 623 * @param pAccessTime Pointer to the new access time. 624 * @param pModificationTime Pointer to the new modification time. 625 * @param pChangeTime Pointer to the new change time. NULL if not to be changed. 626 * @param pBirthTime Pointer to the new time of birth. NULL if not to be changed. 627 * @param fFlags RTPATH_F_ON_LINK or RPATH_F_FOLLOW_LINK. 628 * 629 * @remark The file system might not implement all these time attributes, 630 * the API will ignore the ones which aren't supported. 631 * 632 * @remark The file system might not implement the time resolution 633 * employed by this interface, the time will be chopped to fit. 634 * 635 * @remark The file system may update the change time even if it's 636 * not specified. 637 * 638 * @remark POSIX can only set Access & Modification and will always set both. 639 */ 640 RTR3DECL(int) RTPathSetTimesEx(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, 641 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime, uint32_t fFlags); 642 643 /** 575 644 * Gets one or more of the timestamps associated of file system object. 576 645 * … … 582 651 * @param pBirthTime Where to store the creation time. NULL is ok. 583 652 * 584 * @remark This is wrapper around RTPathQueryInfo() and exists to complement RTPathSetTimes(). 653 * @remark This is wrapper around RTPathQueryInfo() and exists to complement 654 * RTPathSetTimes(). If the last component is a symbolic link, it will 655 * not be resolved. 585 656 */ 586 657 RTR3DECL(int) RTPathGetTimes(const char *pszPath, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime, … … 601 672 602 673 /** 674 * Changes the owner and/or group of a file system object. 675 * 676 * @returns iprt status code. 677 * @param pszPath Path to the file system object. 678 * @param uid The new file owner user id. Use -1 (or ~0) to leave this unchanged. 679 * @param gid The new group id. Use -1 (or ~0) to leave this unchanged. 680 * @param fFlags RTPATH_F_ON_LINK or RPATH_F_FOLLOW_LINK. 681 */ 682 RTR3DECL(int) RTPathSetOwnerEx(const char *pszPath, uint32_t uid, uint32_t gid, uint32_t fFlags); 683 684 /** 603 685 * Gets the owner and/or group of a file system object. 604 686 * … … 608 690 * @param pGid Where to store the group id. NULL is ok. 609 691 * 610 * @remark This is wrapper around RTPathQueryInfo() and exists to complement RTPathGetOwner(). 692 * @remark This is wrapper around RTPathQueryInfo() and exists to complement 693 * RTPathGetOwner(). If the last component is a symbolic link, it will 694 * not be resolved. 611 695 */ 612 696 RTR3DECL(int) RTPathGetOwner(const char *pszPath, uint32_t *pUid, uint32_t *pGid); … … 622 706 * Renames a path within a filesystem. 623 707 * 708 * This will rename symbolic links. If RTPATHRENAME_FLAGS_REPLACE is used and 709 * pszDst is a symbolic link, it will be replaced and not its target. 710 * 624 711 * @returns IPRT status code. 625 712 * @param pszSrc The source path.
Note:
See TracChangeset
for help on using the changeset viewer.