- Use tmp dir to store data for trial.
authorarno <arno@e16421f0-f15b-0410-abcd-98678b794739>
Thu, 12 Nov 2009 14:41:59 +0000 (14:41 +0000)
committerarno <arno@e16421f0-f15b-0410-abcd-98678b794739>
Thu, 12 Nov 2009 14:41:59 +0000 (14:41 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@542 e16421f0-f15b-0410-abcd-98678b794739

exec/trial.cpp

index 2989888..dad4fa0 100644 (file)
@@ -8,6 +8,8 @@
  */
 #include "p2tp.h"
 #include <time.h>
+#include <string>
+#include "compat/util.h"
 
 
 using namespace p2tp;
@@ -19,7 +21,13 @@ int main (int argn, char** args) {
     srand(time(NULL));
     Sha1Hash root_hash(true,"32e5d9d2d8c0f6073e2820cf47b15b58c2e42a23");
     p2tp::LibraryInit();
-    const char* filename = "team.jpg";
+
+    // Arno: use tempdir
+    std::string tmpdir = gettmpdir();
+    std::string sfn = tmpdir+"team.jpg";
+    const char* filename = sfn.c_str();
+
+
     Address tracker("130.161.211.198:10000"),
             bindaddr((uint32_t)INADDR_ANY,10000);
     if (0>p2tp::Listen(bindaddr)) {