- Timestamp:
- Aug 2, 2006, 1:05:52 AM (17 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Directory.cc
r118 r126 134 134 void Directory::print(const bool verbose) const 135 135 { 136 createdir(output_name());136 mkdir(output_name()); 137 137 std::string output(output_name() + "/index.html"); 138 138 if (verbose) -
trunk/lib/utility.cc
r125 r126 31 31 #include <string> 32 32 #include <sys/param.h> 33 #include <sys/stat.h>34 33 #include <unistd.h> 35 34 … … 46 45 std::cerr << "Error: svn blame " << path << std::endl; 47 46 return system_return; 48 }49 50 int createdir(const std::string& dir, bool force)51 {52 struct stat buf;53 if (force && !stat(dir.c_str(),&buf))54 rmdirhier(dir);55 56 return mkdir(dir.c_str(),0777);57 47 } 58 48 -
trunk/lib/utility.h
r118 r126 13 13 svnstat is distributed in the hope that it will be useful, but 14 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 16 General Public License for more details. 17 17 … … 33 33 #include <vector> 34 34 35 #include <sys/stat.h> 36 35 37 namespace theplu{ 36 38 namespace svnstat{ … … 40 42 /// 41 43 int blame(const std::string&); 42 44 43 45 /// 44 46 /// Create directory \a dir. The call can fail in many ways, cf. 'man 45 /// mkdir'. If the \a dir exists, setting \a force to true will 46 /// trigger a recursive removal of the target \a dir. 47 /// mkdir'. 47 48 /// 48 in t createdir(const std::string& dir, bool force=false);49 inline int mkdir(const std::string& dir) { return ::mkdir(dir.c_str(),0777); } 49 50 50 51 /// … … 126 127 }; 127 128 128 129 130 131 129 /// 130 /// @return resulting vector 131 /// 132 template <typename Key, typename T> 132 133 struct PairValuePlus : 133 134 public std::binary_function<std::vector<T>, … … 162 163 }; 163 164 164 }} 165 }} // end of namespace svnstat end of namespace theplu 165 166 166 // end of namespace svnstat end of namespace theplu167 167 #endif
Note: See TracChangeset
for help on using the changeset viewer.