Calls the C stat function and stores its information.
195 :
196 m_path( a_path ) {
197
198 int error = stat( a_path.c_str( ), &m_stat );
199
200 if( error != 0 ) {
201 switch( error ) {
202 case EACCES :
203 throw Exception( "FileStat::FileStat: Permission denied for file '" + a_path + "'.." );
204 case EIO :
205 throw Exception( "FileStat::FileStat: An error occurred while stat-ing file '" + a_path + "'.." );
206 case ELOOP :
207 throw Exception( "FileStat::FileStat: A loop exists in symbolic links for file '" + a_path + "'.." );
208 case ENAMETOOLONG :
209 throw Exception( "FileStat::FileStat: Path name too long '" + a_path + "'." );
210 case ENOENT :
211 throw Exception( "FileStat::FileStat: No such path '" + a_path + "'." );
212 case ENOTDIR :
213 throw Exception( "FileStat::FileStat: A component of the path prefix is not a directory '" + a_path + "'." );
214 case EOVERFLOW :
215 throw Exception( "FileStat::FileStat: File too big: '" + a_path + "'." );
216 default :
217 throw Exception( "FileStat::FileStat: Unknown error from C function 'stat' for file '" + a_path + "'." );
218 }
219 }
220}