Changeset 1627
- Timestamp:
- Nov 17, 2008, 2:27:46 AM (15 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/FileUtil.cc
r1487 r1627 90 90 { 91 91 struct stat statt; 92 if ( stat(path_.c_str(),&statt) && (errno!=ENOENT) ) { 92 return exists_common(stat(path_.c_str(),&statt)); 93 } 94 95 96 bool FileUtil::exists_common(bool failed) const 97 { 98 if ( failed && (errno!=ENOENT) ) { 93 99 std::stringstream ss; 94 100 ss << "stat(2) call failed with errno: " << errno; … … 103 109 104 110 111 bool FileUtil::lexists(void) const 112 { 113 struct stat statt; 114 return exists_common(lstat(path_.c_str(),&statt)); 115 } 116 117 105 118 const std::string& FileUtil::path(void) const 106 119 { -
trunk/yat/utility/FileUtil.h
r1487 r1627 88 88 bool exists(void) const; 89 89 90 /** 91 Same as exists(void) but uses \a lstat rather than \a 92 stat. That implies that the function will return true also if 93 \a path is a broken link. 94 95 \return true if file exists 96 97 \see lstat(2) 98 99 \since New in yat 0.5 100 */ 101 bool lexists(void) const; 102 90 103 /// 91 104 /// \brief Get path associated with the object. … … 98 111 /// 99 112 FileUtil(const FileUtil&); 113 FileUtil& operator=(const FileUtil&); 114 115 bool exists_common(bool) const; 100 116 101 117 std::string path_;
Note: See TracChangeset
for help on using the changeset viewer.