Skip to content

Commit

Permalink
Use stat to check existance of file
Browse files Browse the repository at this point in the history
Old C++ code was invalid in C++11 and breaks on newer clang versions.
  • Loading branch information
sjoelund committed Apr 15, 2016
1 parent 668e389 commit 766fa6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Compiler/runtime/TaskGraphResultsCmp.cpp
Expand Up @@ -31,6 +31,7 @@
#if !defined(_MSC_VER)

#include "TaskGraphResultsCmp.h"
#include <sys/stat.h>

Node::Node() : id(""), name(""), calcTime(-1), threadId(""), taskNumber(-1), taskId(-1), simCodeEqs()
{
Expand Down Expand Up @@ -147,8 +148,8 @@ GraphParser::~GraphParser()

bool GraphParser::CheckIfFileExists(const char* fileName)
{
std::ifstream ifile(fileName);
return (ifile > 0);
struct stat stats;
return 0 == stat(fileName, &stats);
}

GraphMLParser::GraphMLParser() : GraphParser()
Expand Down

0 comments on commit 766fa6a

Please sign in to comment.