jmorrill commented on a change in pull request #4857: Windows Support for 
cpp_rpc
URL: https://github.com/apache/incubator-tvm/pull/4857#discussion_r384841512
 
 

 ##########
 File path: apps/cpp_rpc/rpc_env.cc
 ##########
 @@ -20,141 +20,139 @@
  * \file rpc_env.cc
  * \brief Server environment of the RPC.
  */
+#include <cerrno>
 #include <tvm/runtime/registry.h>
-#include <errno.h>
-#ifndef _MSC_VER
-#include <sys/stat.h>
+#ifndef _WIN32
 #include <dirent.h>
+#include <sys/stat.h>
 #include <unistd.h>
 #else
 #include <Windows.h>
+#include <direct.h>
+namespace {
+  int mkdir(const char* path, int /* ignored */) { return _mkdir(path); }
+}
 #endif
+#include <cstring>
 #include <fstream>
-#include <vector>
 #include <iostream>
 #include <string>
-#include <cstring>
+#include <vector>
+#include <string>
 
-#include "rpc_env.h"
 #include "../../src/support/util.h"
 #include "../../src/runtime/file_util.h"
+#include "rpc_env.h"
+
+namespace {
+#if defined(__linux__) || defined(__ANDROID__)
+  const std::string untar_cmd = "tar -C ";
+#elif defined(_WIN32)
+  const std::string untar_cmd = "wsl tar -C ";
 
 Review comment:
   Looks like I do not need to create a python script at runtime.  It looks 
like something like this would work on windows:
   
   python -m tarfile -e file.tar outdir/
   
   **update**
   
   Just committed the changes to use python to untar

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to