Changeset 1186
- Timestamp:
- Aug 28, 2010, 12:13:37 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/svndigest.cc
r1182 r1186 228 228 std::cout << "Generating output" << std::endl; 229 229 mkdir(tree.name()); 230 chdir(tree.name() .c_str());230 chdir(tree.name()); 231 231 print_css("svndigest.css"); 232 232 print_main_page(tree.name(), tree.log(), stats, tree.url()); -
trunk/bin/svndigestParameter.cc
r1119 r1186 93 93 std::string base_root = file_name(root()); 94 94 std::string path = concatenate_path(target_.value(),base_root); 95 if (access_rights(target_.value() .c_str(), "w")) {95 if (access_rights(target_.value(), "w")) { 96 96 std::stringstream ss; 97 97 ss << "svndigest: cannot create directory `" << path -
trunk/lib/Directory.cc
r1137 r1186 78 78 case SVN::uptodate: 79 79 struct stat nodestat; // C api from sys/stat.h 80 lstat(fullpath .c_str(),&nodestat); // C api from sys/stat.h80 lstat(fullpath,&nodestat); // C api from sys/stat.h 81 81 if (S_ISDIR(nodestat.st_mode)) // C api from sys/stat.h 82 82 daughters_.push_back(new Directory(level_+1,fullpath,local_path())); -
trunk/lib/File.cc
r1154 r1186 225 225 stats_.print(os); 226 226 os.close(); 227 rename(tmp_cache_file .c_str(), cache_file.c_str());227 rename(tmp_cache_file, cache_file); 228 228 return stats_; 229 229 } -
trunk/lib/Node.cc
r1137 r1186 63 63 64 64 struct stat nodestat; // C api from sys/stat.h 65 lstat(path .c_str(),&nodestat); // C api from sys/stat.h65 lstat(path,&nodestat); // C api from sys/stat.h 66 66 link_ = S_ISLNK(nodestat.st_mode); 67 67 } -
trunk/lib/rmdirhier.cc
r1090 r1186 70 70 struct stat buf; 71 71 // using lstat because links should not be treated as dirs 72 lstat(dir .c_str(),&buf);72 lstat(dir, &buf); 73 73 // check if dir - if not delete the node 74 74 if (!(buf.st_mode & S_IFDIR)) { -
trunk/lib/utility.cc
r1132 r1186 170 170 171 171 172 void lstat(const std::string path, struct stat* nodestat) 173 { 174 int res = ::lstat(path.c_str(), nodestat); 175 if (res) { 176 throw yat::utility::errno_error("lstat: "); 177 } 178 } 179 180 172 181 std::string ltrim(std::string str) 173 182 { … … 183 192 if (code){ 184 193 std::stringstream ss; 185 ss << "mkdir (" << dir << "): failed\n" << strerror(errno);186 throw std::runtime_error(ss.str());194 ss << "mkdir: `" << dir << "': "; 195 throw yat::utility::errno_error(ss.str()); 187 196 } 188 197 } … … 294 303 if (code){ 295 304 std::stringstream ss; 296 ss << "rename (" << from << ", " << to << "): failed\n" << strerror(errno);297 throw std::runtime_error(ss.str());305 ss << "rename" << from << " to " << to << ": "; 306 throw yat::utility::errno_error(ss.str()); 298 307 } 299 308 } -
trunk/lib/utility.h
r1132 r1186 115 115 /// 116 116 std::string htrim(std::string str); 117 118 /** 119 same as lstat(2) but throws an errno_error if error is detected 120 */ 121 void lstat(const std::string path, struct stat*); 117 122 118 123 ///
Note: See TracChangeset
for help on using the changeset viewer.