message: torcontrol: use fs::path instead of std:;string for private key path
diff: @@ -310,9 +310,9 @@ static std::map<std::string,std::string> ParseTorReplyMapping(const std::string
  * @param maxsize Puts a maximum size limit on the file that is read. If the file is larger than this, truncated data
  * (with len > maxsize) will be returned.
  */
  -static std::pair<bool,std::string> ReadBinaryFile(const std::string &filename, size_t maxsize=std::numeric_limits<size_t>::max())
  +static std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size_t maxsize=std::numeric_limits<size_t>::max())
  {
  - FILE *f = fopen(filename.c_str(), "rb");
  + FILE *f = fsbridge::fopen(filename, "rb");
  if (f == NULL)
  return std::make_pair(false,"");
  std::string retval;
  @@ -330,9 +330,9 @@ static std::pair<bool,std::string> ReadBinaryFile(const std::string &filename, s
  /** Write contents of std::string to a file.
  * @return true on success.
  */
  -static bool WriteBinaryFile(const std::string &filename, const std::string &data)
  +static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
  {
  - FILE *f = fopen(filename.c_str(), "wb");
  + FILE *f = fsbridge::fopen(filename, "wb");
  if (f == NULL)
  return false;
  if (fwrite(data.data(), 1, data.size(), f) != data.size()) {
  @@ -355,7 +355,7 @@ public:
  ~TorController();
  /** Get name fo file to store private key in */
  - std::string GetPrivateKeyFile();
  + fs::path GetPrivateKeyFile();
  /** Reconnect, after getting disconnected */
  void Reconnect();
  @@ -407,7 +407,7 @@ TorController::TorController(struct event_base* baseIn, const std::string& targe
  // Read service private key if cached
  std::pair<bool,std::string> pkf = ReadBinaryFile(GetPrivateKeyFile());
  if (pkf.first) {
  - LogPrint("tor", "tor: Reading cached private key from %s\n", GetPrivateKeyFile());
  + LogPrint("tor", "tor: Reading cached private key from %s\n", GetPrivateKeyFile().string());
  private_key = pkf.second;
  }
  }
  @@ -439,9 +439,9 @@ void TorController::add_onion_cb(TorControlConnection& conn, const TorControlRep
  service = CService(service_id+".onion", GetListenPort());
  LogPrintf("tor: Got service ID %s, advertising service %s\n", service_id, service.ToString());
  if (WriteBinaryFile(GetPrivateKeyFile(), private_key)) {
  - LogPrint("tor", "tor: Cached service private key to %s\n", GetPrivateKeyFile());
  + LogPrint("tor", "tor: Cached service private key to %s\n", GetPrivateKeyFile().string());
  } else {
  - LogPrintf("tor: Error writing service private key to %s\n", GetPrivateKeyFile());
  + LogPrintf("tor: Error writing service private key to %s\n", GetPrivateKeyFile().string());
  }
  AddLocal(service, LOCAL_MANUAL);
  // ... onion requested - keep connection open
  @@ -645,9 +645,9 @@ void TorController::Reconnect()
  }
  }
  -std::string TorController::GetPrivateKeyFile()
  +fs::path TorController::GetPrivateKeyFile()
  {
  - return (GetDataDir() / "onion_private_key").string();
  + return GetDataDir() / "onion_private_key";
  }
  void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg)
  