File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ def compile_checker(src_dir: str) -> None:
1515 """
1616 chk_cpp = os .path .join (src_dir , "chk.cpp" )
1717 checker_cpp = os .path .join (src_dir , "checker.cpp" )
18+ chk_exec = os .path .join (src_dir , "chk" )
19+ checker_exec = os .path .join (src_dir , "checker" )
20+
21+ if os .path .isfile (chk_exec ) and os .access (chk_exec , os .X_OK ):
22+ print (f"✅ 检查器已存在且可执行: { chk_exec } " , file = sys .stderr , flush = True )
23+ return
24+
25+ if os .path .isfile (checker_exec ) and os .access (checker_exec , os .X_OK ):
26+ os .rename (checker_exec , chk_exec )
27+ print ("✅ 已将 checker 可执行文件重命名为 chk" , file = sys .stderr , flush = True )
28+ return
1829
1930 # 如果 chk.cpp 不存在,则尝试从 checker.cpp 复制
2031 if not os .path .isfile (chk_cpp ):
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ function uojRandAvaiableTmpFileName() {
2727function uojRandAvaiableSubmissionFileName () {
2828 $ num = uojRand (1 , 10000 );
2929 if (!file_exists (UOJContext::storagePath ()."/submission/ $ num " )) {
30- system ("mkdir " .UOJContext::storagePath ()."/submission/ $ num " );
30+ //system("mkdir ".UOJContext::storagePath()."/submission/$num");
31+ system ("mkdir -m 777 " .UOJContext::storagePath ()."/submission/ $ num " );
3132 }
3233 return uojRandAvaiableFileName ("/submission/ $ num/ " );
3334}
You can’t perform that action at this time.
0 commit comments