1 /***************************************************************************
2 escape.cpp - escaping of strings
4 begin : Sun Nov 14 1999
5 copyright : (C) 1999 by Intra2net AG
6 email : info@intra2net.com
7 ***************************************************************************/
12 #include <sys/types.h>
18 #include <filefunc.hxx>
22 long fsize (const string &name)
28 if (lstat(name.c_str(), &statbuff) < 0)
31 if (!S_ISREG(statbuff.st_mode))
34 iReturn=statbuff.st_size;
39 string load_file(const string &name)
44 if (name.find ("..") != string::npos)
45 return ("can't load file (..): " + name);
47 f=::fopen(name.c_str(),"rb");
53 ::fseek(f,0,SEEK_END);
55 ::fseek(f,0,SEEK_SET);
56 char *c=new char[size+1];
65 bool chown(const char* file,const char* owner, const char* group)
82 if (!::chown(file,uid,gid))