Changeset 1437 for trunk/yat/utility/FileUtil.cc
- Timestamp:
- Aug 25, 2008, 7:55:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/FileUtil.cc
r1261 r1437 7 7 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 8 8 9 This file is part of the yat library, http:// trac.thep.lu.se/yat9 This file is part of the yat library, http://dev.thep.lu.se/yat 10 10 11 11 The yat library is free software; you can redistribute it and/or … … 31 31 #include <iostream> 32 32 #include <stdexcept> 33 #include <sstream> 33 34 #include <string> 34 35 … … 70 71 break; 71 72 case 'd': 72 struct stat nodestat;73 stat (tryme.c_str(),&nodestat);73 struct stat64 nodestat; 74 stat64(tryme.c_str(),&nodestat); 74 75 if (!S_ISDIR(nodestat.st_mode)) 75 76 ok = false; … … 86 87 bool FileUtil::exists(void) const 87 88 { 88 struct stat statt; 89 if ( stat(path_.c_str(),&statt) && (errno!=ENOENT) ) 90 throw IO_error(std::string("stat(2) call failed with errno: "+errno)); 89 struct stat64 statt; 90 if ( stat64(path_.c_str(),&statt) && (errno!=ENOENT) ) { 91 std::stringstream ss; 92 ss << "stat64(2) call failed with errno: " << errno; 93 throw IO_error(ss.str()); 94 } 91 95 if (errno) { 92 96 errno = 0; // don't leave errno in state of failure
Note: See TracChangeset
for help on using the changeset viewer.