projects
/
manu
/
suphp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import upstream 0.7.1
[manu/suphp.git]
/
src
/
File.cpp
diff --git
a/src/File.cpp
b/src/File.cpp
index
6c6d303
..
d5183f3
100644
(file)
--- a/
src/File.cpp
+++ b/
src/File.cpp
@@
-1,5
+1,5
@@
/*
/*
- suPHP - (c)2002-200
5
Sebastian Marsching <sebastian@marsching.com>
+ suPHP - (c)2002-200
8
Sebastian Marsching <sebastian@marsching.com>
This file is part of suPHP.
This file is part of suPHP.
@@
-36,12
+36,12
@@
std::string suPHP::File::getPath() const{
return this->path;
}
return this->path;
}
-SmartPtr<std::ifstream> suPHP::File::getInputStream() throw (IOException) {
+SmartPtr<std::ifstream> suPHP::File::getInputStream()
const
throw (IOException) {
std::ifstream* infile = new std::ifstream();
infile->open(this->path.c_str());
if (infile->bad() || infile->fail()) {
std::ifstream* infile = new std::ifstream();
infile->open(this->path.c_str());
if (infile->bad() || infile->fail()) {
- throw IOException("Could not open file " +
- this->path + " for reading", __FILE__, __LINE__);
+
throw IOException("Could not open file " +
+
this->path + " for reading", __FILE__, __LINE__);
}
return SmartPtr<std::ifstream>(infile);
}
}
return SmartPtr<std::ifstream>(infile);
}
@@
-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('/'));
File suPHP::File::getParentDirectory() const {
std::string path = this->getPath();
path = path.substr(0, path.rfind('/'));
+ if (path.length() == 0) {
+ path = "/";
+ }
return File(path);
}
return File(path);
}
@@
-104,3
+107,8
@@
UserInfo suPHP::File::getUser() const throw (SystemException) {
GroupInfo suPHP::File::getGroup() const throw (SystemException) {
return API_Helper::getSystemAPI().File_getGroup(*this);
}
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);
+}