bool FileBody::Move(const fs::path& new_path) {
  if (path_ == new_path) {
    return false;
  }

  if (ifstream_.is_open()) {
    ifstream_.close();
  }

  fs::error_code ec;
  fs::rename(path_, new_path, ec);

  if (ec) {
    LOG_ERRO("Failed to rename file (%s).", ec.message().c_str());
    return false;
  }

  // Reset original file path.
  path_.clear();

  return true;
}
bool FileBody::Move(const fs::path& new_path) {
  if (path_ == new_path) {
    return false;
  }

  if (ifstream_.is_open()) {
    ifstream_.close();
  }

  fs::error_code ec;
  fs::rename(path_, new_path, ec);

  if (ec) {
    LOG_ERRO("Failed to rename file (%s).", ec.message().c_str());
    return false;
  }

   
  path_.clear();

  return true;
}