Changeset 1437 for trunk/gsdl/lib
- Timestamp:
- 2000-08-21T16:47:48+12:00 (24 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/fileutil.cpp
r1434 r1437 253 253 #endif 254 254 } 255 256 // returns the last line (or last 256 characters) 257 // of filename file 258 text_t file_tail (const text_t &filename) { 259 260 text_t return_str; 261 char *filenamec = filename.getcstr(); 262 263 ifstream file_in (filenamec); 264 if (file_in) { 265 file_in.seekg (256, ios::end); 266 char c; 267 file_in.get(c); 268 while (!file_in.eof()) { 269 if (c == '\n') return_str.clear(); 270 else return_str.push_back (c); 271 file_in.get(c); 272 } 273 file_in.close(); 274 } 275 delete filenamec; 276 return return_str; 277 } -
trunk/gsdl/lib/fileutil.h
r1426 r1437 51 51 void file_copy (const text_t &fromfile, const text_t &tofile); 52 52 53 text_t file_tail (const text_t &filename); 54 53 55 #endif
Note:
See TracChangeset
for help on using the changeset viewer.