bool suPHP::API_Linux::File_exists(const File& file) const {
struct stat dummy;
- if (::stat(file.getPath().c_str(), &dummy) == 0)
- return true;
+ if (::lstat(file.getPath().c_str(), &dummy) == 0)
+ return true;
else
- return false;
+ return false;
}
std::string suPHP::API_Linux::File_getRealPath(const File& file) const
bool suPHP::API_Linux::File_hasPermissionBit(const File& file, FileMode perm)
const throw (SystemException) {
struct stat temp;
- if (stat(file.getPath().c_str(), &temp) == -1) {
+ if (lstat(file.getPath().c_str(), &temp) == -1) {
throw SystemException(std::string("Could not stat \"")
+ file.getPath() + "\": "
+ ::strerror(errno), __FILE__, __LINE__);
UserInfo suPHP::API_Linux::File_getUser(const File& file) const
throw (SystemException) {
struct stat temp;
- if (stat(file.getPath().c_str(), &temp) == -1) {
+ if (lstat(file.getPath().c_str(), &temp) == -1) {
throw SystemException(std::string("Could not stat \"")
+ file.getPath() + "\": "
+ ::strerror(errno), __FILE__, __LINE__);
GroupInfo suPHP::API_Linux::File_getGroup(const File& file) const
throw (SystemException) {
struct stat temp;
- if (stat(file.getPath().c_str(), &temp) == -1) {
+ if (lstat(file.getPath().c_str(), &temp) == -1) {
throw SystemException(std::string("Could not stat \"")
+ file.getPath() + "\": "
+ ::strerror(errno), __FILE__, __LINE__);
}
+bool suPHP::API_Linux::File_isSymlink(const File& file) const throw (SystemException) {
+ return this->isSymlink(file.getPath());
+}
+
+
void suPHP::API_Linux::execute(std::string program, const CommandLine& cline,
const Environment& env) const
throw (SystemException) {