Skip to content

Commit

Permalink
Remove intemediate files (#129)
Browse files Browse the repository at this point in the history
* Adding library name (CXXGRAPH) in header guards to avoid possible conflicts in include folders Node and Graph

* Adding library name (CXXGRAPH) in header guards to avoid possible conflicts in include folders Edge, Partitioning and Utility

* Added code to remove reading intermediate files and removed lines in tests not needed anymore

Co-authored-by: Parrot User <user@localhost.localdomain>
  • Loading branch information
AlfredCP and Parrot User committed Oct 19, 2021
1 parent b611046 commit b0f661c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions include/Graph/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ namespace CXXGRAPH
ifileGraph.ignore(128, '\n');
}
ifileGraph.close();
if (compress) remove(completePathToFileGraph.c_str());

if (readNodeFeat)
{
Expand All @@ -611,6 +612,7 @@ namespace CXXGRAPH
ifileNodeFeat.ignore(128, '\n');
}
ifileNodeFeat.close();
if (compress) remove(completePathToFileNodeFeat.c_str());
}

if (readEdgeWeight)
Expand Down Expand Up @@ -638,6 +640,7 @@ namespace CXXGRAPH
ifileEdgeWeight.ignore(128, '\n');
}
ifileEdgeWeight.close();
if (compress) remove(completePathToFileEdgeWeight.c_str());
}
recreateGraphFromReadFiles(edgeMap, edgeDirectedMap, nodeFeatMap, edgeWeightMap);
return 0;
Expand Down Expand Up @@ -728,6 +731,7 @@ namespace CXXGRAPH
ifileGraph.ignore(128, '\n');
}
ifileGraph.close();
if (compress) remove(completePathToFileGraph.c_str());

if (readNodeFeat)
{
Expand All @@ -750,6 +754,7 @@ namespace CXXGRAPH
ifileNodeFeat.ignore(128, '\n');
}
ifileNodeFeat.close();
if (compress) remove(completePathToFileNodeFeat.c_str());
}

if (readEdgeWeight)
Expand Down Expand Up @@ -777,6 +782,7 @@ namespace CXXGRAPH
ifileEdgeWeight.ignore(128, '\n');
}
ifileEdgeWeight.close();
if (compress) remove(completePathToFileEdgeWeight.c_str());
}
recreateGraphFromReadFiles(edgeMap, edgeDirectedMap, nodeFeatMap, edgeWeightMap);
return 0;
Expand Down
6 changes: 0 additions & 6 deletions test/RWOutputTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,6 @@ TEST(RWOutputTest, test_22)
}
}

remove("test_22.csv");
remove("test_22_NodeFeat.csv");
remove("test_22_EdgeWeight.csv");
remove("test_22.csv.gz");
remove("test_22_NodeFeat.csv.gz");
remove("test_22_EdgeWeight.csv.gz");
Expand Down Expand Up @@ -995,9 +992,6 @@ TEST(RWOutputTest, test_25)
}
}

remove("test_25.tsv");
remove("test_25_NodeFeat.tsv");
remove("test_25_EdgeWeight.tsv");
remove("test_25.tsv.gz");
remove("test_25_NodeFeat.tsv.gz");
remove("test_25_EdgeWeight.tsv.gz");
Expand Down

0 comments on commit b0f661c

Please sign in to comment.