Repository: VILLASframework/node (language: python)

Issue:
`file` node-type can't read files.
The `file` node-type always truncates the file unconditionally (fopen with "w+").
This has been broken for about 2 years.

Seems like [this](https://github.com/VILLASframework/node/commit/784e970bfe48cf75da7622ca4c4a13fb529cce59) commit changed the file mode from "a+" to "w+".


Discussion / hints:

Fix patch:
diff --git a/lib/nodes/file.cpp b/lib/nodes/file.cpp
index c398c92db..631cd02f8 100644
--- a/lib/nodes/file.cpp
+++ b/lib/nodes/file.cpp
@@ -262,7 +262,7 @@ int villas::node::file_start(NodeCompat *n)
 	f->formatter->start(n->getInputSignals(false));
 
 	/* Open file */
-	f->stream_out = fopen(f->uri, "w+");
+	f->stream_out = fopen(f->uri, "a+");
 	if (!f->stream_out)
 		return -1;
 


Test patch:
diff --git a/tests/integration/node-multiplexing.sh b/tests/integration/node-multiplexing.sh
index 6f2b84bbd..53d7720b8 100755
--- a/tests/integration/node-multiplexing.sh
+++ b/tests/integration/node-multiplexing.sh
@@ -119,4 +119,6 @@ villas node config.json
 
 villas compare output.dat expect_${MODE}.dat
 
+rm output.dat
+
 done