From: Philippe E. <ph...@us...> - 2003-04-16 21:06:33
|
Update of /cvsroot/oprofile/oprofile/libutil++ In directory sc8-pr-cvs1:/tmp/cvs-serv28289/libutil++ Modified Files: Tag: pp-interface-branch file_manip.cpp file_manip.h Log Message: implement new sample filename scheme in dae/. daemon/ updated too but not tested (compile fine). Update opcontrol but still use the old --ctr syntax to specify events. 2.4 daemon seems to run fine but not already stressed. I updated TODO by mentionning all broken things but surely not exhaustive. regards, Phil Index: file_manip.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/file_manip.cpp,v retrieving revision 1.17 retrieving revision 1.17.4.1 diff -u -d -r1.17 -r1.17.4.1 --- file_manip.cpp 26 Oct 2002 17:36:22 -0000 1.17 +++ file_manip.cpp 16 Apr 2003 21:05:56 -0000 1.17.4.1 @@ -48,52 +48,6 @@ } /** - * create_dir - create a directory - * @param dir the directory name to create - * - * return false if the directory dir does not exist - * and cannot be created - */ -bool create_dir(string const & dir) -{ - if (access(dir.c_str(), F_OK)) { - if (mkdir(dir.c_str(), 0700)) - return false; - } - return true; -} - -/** - * create_path - create a path - * @param path the path to create - * - * create directory for each dir components in path - * return false if one of the path cannot be created. - */ -bool create_path(string const & path) -{ - vector<string> path_component; - - size_t slash = 0; - while (slash < path.length()) { - size_t new_pos = path.find_first_of('/', slash); - if (new_pos == string::npos) - new_pos = path.length(); - - path_component.push_back(path.substr(slash, (new_pos - slash) + 1)); - slash = new_pos + 1; - } - - string dir_name; - for (size_t i = 0 ; i < path_component.size() ; ++i) { - dir_name += '/' + path_component[i]; - if (!create_dir(dir_name)) - return false; - } - return true; -} - -/** * op_read_link - read the contents of a symbolic link file * @param name the file name * Index: file_manip.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/libutil++/file_manip.h,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -d -r1.12 -r1.12.4.1 --- file_manip.h 27 Sep 2002 23:12:39 -0000 1.12 +++ file_manip.h 16 Apr 2003 21:05:59 -0000 1.12.4.1 @@ -17,10 +17,6 @@ /// return true if the two files are the same file bool is_files_identical(std::string const & file1, std::string const & file2); -/// create a directory, return false on failure -bool create_dir(std::string const & dir); -/// create each component of the path, return false on failure -bool create_path(std::string const & path); /// return the contents of a symbolic link or an empty string on failure std::string op_read_link(std::string const & name); /// return true if the given file is readable |