Write a command-line tool /app/archive safe.py that safely extracts a ZIP archive into a target directory…
Write a command-line tool /app/archive safe.py that safely extracts a ZIP archive into a target directory…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input contract: - The script receives exactly two positional arguments: 1. Path to a ZIP file (may not exist…
The task
**Input contract:** - The script receives exactly two positional arguments: 1. Path to a ZIP file (may not exist, may be corrupt, may be empty). 2. Path to a target directory (will already exist and be empty). - The ZIP may contain files and directories with arbitrary names, timestamps, permissions (stored as Unix…
Part of ai-and/termgrade-environments.