Skip to content

Commit

Permalink
Use hard links instead of copying
Browse files Browse the repository at this point in the history
See #57
  • Loading branch information
niknetniko committed May 24, 2024
1 parent 04118a6 commit ade5b1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tested/judge/execution.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import itertools
import logging
import shutil
from pathlib import Path

from attrs import define
Expand Down Expand Up @@ -176,7 +175,10 @@ def set_up_unit(
_logger.debug(f"Copying {origin} to {destination}")
if origin == destination:
continue # Don't copy the file to itself
shutil.copy2(origin, destination)

# Use hard links instead of copying, due to issues with busy files.
# See https://github.com/dodona-edu/universal-judge/issues/57
destination.hardlink_to(origin)

return execution_dir, dependencies

Expand Down

0 comments on commit ade5b1f

Please sign in to comment.