Page MenuHomePhabricator

refuse to overwrite an existing file with extract_xcode.py
ClosedPublic

Authored by PiRK on May 26 2023, 13:30.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCfcdb2bdcf1fa: refuse to overwrite an existing file with extract_xcode.py
Summary

It is really easy to mess up the command line when trying to process the xcode archive, and as a result delete the input file because the script treats it as the output file.

Example of bad command:

extract_xcode.py input_file.xip | cpio -d -i

This change prevents loss of gigabytes of data by simply refusing to overwrite the output file. The user can manually delete it before running the command, if overwriting is really he really intends to do.

Test Plan

Check that this command refuses to delete the file.

touch input_file.xip
extract_xcode.py input_file.xip

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable