From e81fc564812392bd5d5c16c21e1a1c16f2d66051 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Thu, 21 Mar 2019 08:31:40 +0800 Subject: [PATCH] fix permission denied --- server/judge_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/judge_client.py b/server/judge_client.py index 9019860..0963759 100644 --- a/server/judge_client.py +++ b/server/judge_client.py @@ -2,6 +2,7 @@ import _judger import hashlib import json import os +import shutil from multiprocessing import Pool import psutil @@ -108,7 +109,7 @@ class JudgeClient(object): # todo check permission user_output_file = os.path.join(user_output_dir, self._io_mode["output"]) real_user_output_file = os.path.join(user_output_dir, "stdio.txt") - os.symlink(in_file, os.path.join(user_output_dir, self._io_mode["input"])) + shutil.copyfile(in_file, os.path.join(user_output_dir, self._io_mode["input"])) kwargs = {"input_path": in_file, "output_path": real_user_output_file, "error_path": real_user_output_file} else: real_user_output_file = user_output_file = os.path.join(self._submission_dir, test_case_file_id + ".out")