2 suPHP - (c)2002-2005 Sebastian Marsching <sebastian@marsching.com>
4 This file is part of suPHP.
6 suPHP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 suPHP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with suPHP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 FILEMODE_OTHERS_WRITE,
45 #include "IOException.hpp"
46 #include "SystemException.hpp"
47 #include "SmartPtr.hpp"
48 #include "UserInfo.hpp"
49 #include "GroupInfo.hpp"
54 * Class encapsulating file information and access.
59 bool hasPermissionBit(FileMode perm) const throw (SystemException);
65 File(std::string path);
68 * Returns path to file
70 std::string getPath() const;
73 * Returns input stream to read from file
75 SmartPtr<std::ifstream> getInputStream() throw (IOException);
83 * Returns real path to file (without symlinks in path)
85 std::string getRealPath() const throw (SystemException);
88 * Returns File object representing parent directory
90 File getParentDirectory() const;
93 * Returns permission bit
95 bool hasUserReadBit() const throw (SystemException);
98 * Returns permission bit
100 bool hasUserWriteBit() const throw (SystemException);
103 * Returns permission bit
105 bool hasUserExecuteBit() const throw (SystemException);
108 * Returns permission bit
110 bool hasGroupReadBit() const throw (SystemException);
113 * Returns permission bit
115 bool hasGroupWriteBit() const throw (SystemException);
118 * Returns permission bit
120 bool hasGroupExecuteBit() const throw (SystemException);
123 * Returns permission bit
125 bool hasOthersReadBit() const throw (SystemException);
128 * Returns permission bit
130 bool hasOthersWriteBit() const throw (SystemException);
133 * Returns permission bit
135 bool hasOthersExecuteBit() const throw (SystemException);
138 * Returns owner (user) of file
140 UserInfo getUser() const throw (SystemException);
143 * Returns owning group of file
145 GroupInfo getGroup() const throw (SystemException);
150 #endif // SUPHP_FILE_H