Changeset 2212
- Timestamp:
- Mar 12, 2010, 4:30:35 AM (14 years ago)
- Location:
- branches/0.6-stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.6-stable/test/fileutil_test.cc
r2121 r2212 4 4 Copyright (C) 2006 Jari Häkkinen 5 5 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 6 Copyright (C) 2009 Peter Johansson6 Copyright (C) 2009, 2010 Peter Johansson 7 7 8 8 This file is part of the yat library, http://dev.thep.lu.se/yat … … 180 180 } 181 181 182 // checking permissions on non-existence file in `/' 183 try { 184 suite.err() << "FileUtil Test 7" << std::endl; 185 // intermediate dir must be unique! 186 utility::FileUtil file("/theplu_yat_fileutil_test.sdf34DSF"); 187 if(!suite.add(file.permissions("r") == 0)) { 188 suite.err() << " r permission failed on " << file.path() << std::endl; 189 } 190 } 191 catch (utility::IO_error e) { 192 suite.add(false); 193 suite.err() << e.what() << std::endl; 194 } 195 196 182 197 return suite.return_value(); 183 198 } -
branches/0.6-stable/yat/utility/FileUtil.cc
r2125 r2212 6 6 Copyright (C) 2006 Jari Häkkinen 7 7 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2009 Peter Johansson8 Copyright (C) 2009, 2010 Peter Johansson 9 9 10 10 This file is part of the yat library, http://dev.thep.lu.se/yat … … 66 66 if (!exists()) { 67 67 std::string::size_type pos=path_.find_last_of('/'); 68 tryme = ( (pos!=std::string::npos) ? path_.substr(0,pos) : "." ); 68 if (pos == std::string::npos) 69 tryme = "."; 70 else if (pos == 0) 71 tryme = "/"; 72 else 73 tryme.resize(pos); 69 74 } 70 75
Note: See TracChangeset
for help on using the changeset viewer.