libcamgm
PathUtils.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | core library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: PathUtils.hpp
15 
16  Author: Michael Calmer
17  Michael Andres
18  Maintainer: Michael Calmer
19 
20  Purpose:
21 
22 /-*/
29 #ifndef CA_MGM_PATH_UTILS_HPP
30 #define CA_MGM_PATH_UTILS_HPP
31 
32 #include <ca-mgm/config.h>
33 #include <ca-mgm/PathName.hpp>
34 #include <list>
35 
36 
37 namespace CA_MGM_NAMESPACE
38 {
39 
43 namespace path
44 {
45 
63  int createDir(const PathName &path, mode_t mode = 0755);
64 
65 
80  int createDirRecursive(const PathName &path, mode_t mode = 0755);
81 
82 
92  int removeDir(const PathName& path);
93 
94 
108  int removeDirRecursive(const PathName& path );
109 
110 
120  int copyDir(const PathName& srcPath, const PathName& destPath);
121 
129  int readDir(std::list<std::string> & retlist,
130  const PathName& path, bool dots);
131 
137  int removeFile(const PathName& path);
138 
144  int moveFile(const PathName& oldPath, const PathName& newPath);
145 
152  int copyFile(const PathName& file, const PathName& dest);
153 
160  int symLink(const PathName& oldPath, const PathName& newPath);
161 
167  int changeMode(const PathName& path, mode_t mode);
168 
172  // int changeOwner(const PathName& path, const std::string& uid, const std::string& gid);
173 
174 }
175 }
176 
177 #endif /* CA_MGM_PATH_UTILS_HPP */
int removeDirRecursive(const PathName &path)
Remove a directory recursively.
int readDir(std::list< std::string > &retlist, const PathName &path, bool dots)
int createDir(const PathName &path, mode_t mode=0755)
Create a directory.
LiMaL path name manipulation utilities.
int removeDir(const PathName &path)
Remove a directory.
int removeFile(const PathName &path)
int moveFile(const PathName &oldPath, const PathName &newPath)
int createDirRecursive(const PathName &path, mode_t mode=0755)
int copyFile(const PathName &file, const PathName &dest)
int changeMode(const PathName &path, mode_t mode)
int copyDir(const PathName &srcPath, const PathName &destPath)
int symLink(const PathName &oldPath, const PathName &newPath)