00001 #include <glibmm.h>
00002
00003 #include <arc/Thread.h>
00004
00005 #ifdef WIN32
00006 #ifndef uid_t
00007 #define uid_t int
00008 #endif
00009 #ifndef gid_t
00010 #define gid_t int
00011 #endif
00012 #endif
00013
00014 namespace Arc {
00015
00022
00025 bool FileCopy(const std::string& source_path,const std::string& destination_path, uid_t uid, gid_t gid);
00026
00028 bool FileCopy(const std::string& source_path,const std::string& destination_path);
00029
00031 bool FileCopy(const std::string& source_path,int destination_handle);
00032
00034 bool FileCopy(int source_handle,const std::string& destination_path);
00035
00037 bool FileCopy(int source_handle,int destination_handle);
00038
00041
00045 bool FileRead(const std::string& filename, std::list<std::string>& data, uid_t uid=0, gid_t gid=0);
00046
00049 bool FileRead(const std::string& filename, std::string& data, uid_t uid=0, gid_t gid=0);
00050
00053
00057 bool FileCreate(const std::string& filename, const std::string& data, uid_t uid=0, gid_t gid=0, mode_t mode = 0);
00058
00060 bool FileStat(const std::string& path,struct stat *st,bool follow_symlinks);
00061
00064 bool FileStat(const std::string& path,struct stat *st,uid_t uid,gid_t gid,bool follow_symlinks);
00065
00067 bool FileLink(const std::string& oldpath,const std::string& newpath, bool symbolic);
00068
00071 bool FileLink(const std::string& oldpath,const std::string& newpath,uid_t uid,gid_t gid,bool symbolic);
00072
00074 std::string FileReadLink(const std::string& path);
00075
00078 std::string FileReadLink(const std::string& path,uid_t uid,gid_t gid);
00079
00081 bool FileDelete(const std::string& path);
00082
00085 bool FileDelete(const std::string& path,uid_t uid,gid_t gid);
00086
00088 bool DirCreate(const std::string& path,mode_t mode,bool with_parents = false);
00089
00092 bool DirCreate(const std::string& path,uid_t uid,gid_t gid,mode_t mode,bool with_parents = false);
00093
00096 bool DirDelete(const std::string& path, bool recursive = true);
00097
00101 bool DirDelete(const std::string& path, bool recursive, uid_t uid, gid_t gid);
00102
00104
00106 bool TmpDirCreate(std::string& path);
00107
00110
00115 bool TmpFileCreate(std::string& filename, const std::string& data, uid_t uid=0, gid_t gid=0, mode_t mode = 0);
00116
00121 bool CanonicalDir(std::string& name, bool leading_slash = true);
00122
00123 }
00124