33import subprocess
44
55from dmoj .contrib import contrib_modules
6+ from dmoj .cptbox .filesystem_policies import ExactFile
67from dmoj .error import InternalError
78from dmoj .judgeenv import env , get_problem_root
89from dmoj .result import CheckerResult
@@ -25,10 +26,10 @@ def get_executor(problem_id, files, flags, lang, compiler_time_limit):
2526def check (
2627 process_output ,
2728 judge_output ,
28- judge_input ,
2929 problem_id ,
3030 files ,
3131 lang ,
32+ case ,
3233 time_limit = env ['generator_time_limit' ],
3334 memory_limit = env ['generator_memory_limit' ],
3435 compiler_time_limit = env ['generator_compiler_limit' ],
@@ -46,16 +47,23 @@ def check(
4647
4748 args_format_string = args_format_string or contrib_modules [type ].ContribModule .get_checker_args_format_string ()
4849
49- with mktemp (judge_input ) as input_file , mktemp (process_output ) as output_file , mktemp (judge_output ) as answer_file :
50+ with mktemp (process_output ) as output_file , mktemp (judge_output ) as answer_file :
51+ input_path = case .input_data_fd ().to_path ()
52+
5053 checker_args = shlex .split (
5154 args_format_string .format (
52- input_file = shlex .quote (input_file . name ),
55+ input_file = shlex .quote (input_path ),
5356 output_file = shlex .quote (output_file .name ),
5457 answer_file = shlex .quote (answer_file .name ),
5558 )
5659 )
5760 process = executor .launch (
58- * checker_args , stdout = subprocess .PIPE , stderr = subprocess .PIPE , memory = memory_limit , time = time_limit
61+ * checker_args ,
62+ stdout = subprocess .PIPE ,
63+ stderr = subprocess .PIPE ,
64+ memory = memory_limit ,
65+ time = time_limit ,
66+ extra_fs = [ExactFile (input_path )],
5967 )
6068
6169 proc_output , error = process .communicate ()
0 commit comments