- Timestamp:
- Nov 17, 2008, 10:24:18 PM (12 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/FileUtil.cc
r1627 r1628 98 98 if ( failed && (errno!=ENOENT) ) { 99 99 std::stringstream ss; 100 ss << "stat(2) call failed with errno: " << errno; 100 ss << "stat(2) call failed with errno: " << errno << "\n" 101 << strerror(errno); 101 102 throw IO_error(ss.str()); 102 103 } -
trunk/yat/utility/OptionFile.cc
r1487 r1628 48 48 return; 49 49 FileUtil fu(value().c_str()); 50 if (exist_ && !fu.exists()){ 50 bool exists=false; 51 try { 52 exists = fu.exists(); 53 } 54 catch (IO_error& e) { 55 std::stringstream ss; 56 ss << "cannot stat `" << value() << "': " << strerror(errno); 57 errno = 0; 58 throw cmd_error(ss.str()); 59 } 60 if (exist_ && !exists){ 51 61 std::stringstream ss; 52 62 ss << "cannot stat `" << value() << "': No such file or directory"; … … 58 68 if (*iter=='r' && fu.permissions("r")){ 59 69 std::stringstream ss; 60 ss << "cannot stat `" << value() << "': No such file or directory";70 ss << "cannot open `" << value() << "' for reading: Permission denied"; 61 71 throw cmd_error(ss.str()); 62 72 }
Note: See TracChangeset
for help on using the changeset viewer.