fix permission denied

This commit is contained in:
virusdefender 2019-03-21 08:31:40 +08:00
parent 35ca0b6dbd
commit e81fc56481

View File

@ -2,6 +2,7 @@ import _judger
import hashlib import hashlib
import json import json
import os import os
import shutil
from multiprocessing import Pool from multiprocessing import Pool
import psutil import psutil
@ -108,7 +109,7 @@ class JudgeClient(object):
# todo check permission # todo check permission
user_output_file = os.path.join(user_output_dir, self._io_mode["output"]) 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") 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} kwargs = {"input_path": in_file, "output_path": real_user_output_file, "error_path": real_user_output_file}
else: else:
real_user_output_file = user_output_file = os.path.join(self._submission_dir, test_case_file_id + ".out") real_user_output_file = user_output_file = os.path.join(self._submission_dir, test_case_file_id + ".out")