X-Git-Url: http://git.home-dn.net/?p=manu%2Fsuphp.git;a=blobdiff_plain;f=src%2FFile.cpp;fp=src%2FFile.cpp;h=b0b20c251583588edbb491b7026cbf938b3abb53;hp=6c6d303d4b4d548c31539351f5b63cb220656ee2;hb=2a758f9f80a0074585f6a4c603cde9be03502d4e;hpb=a93e48d4dea5133e6b0c7d88cfa39557cd6637bb diff --git a/src/File.cpp b/src/File.cpp index 6c6d303..b0b20c2 100644 --- a/src/File.cpp +++ b/src/File.cpp @@ -57,6 +57,9 @@ std::string suPHP::File::getRealPath() const throw (SystemException) { File suPHP::File::getParentDirectory() const { std::string path = this->getPath(); path = path.substr(0, path.rfind('/')); + if (path.length() == 0) { + path = "/"; + } return File(path); } @@ -104,3 +107,7 @@ UserInfo suPHP::File::getUser() const throw (SystemException) { GroupInfo suPHP::File::getGroup() const throw (SystemException) { return API_Helper::getSystemAPI().File_getGroup(*this); } + +bool suPHP::File::isSymlink() const throw (SystemException) { + return API_Helper::getSystemAPI().File_isSymlink(*this); +}