diff --git a/contrib/apple-sdk-tools/extract_xcode.py b/contrib/apple-sdk-tools/extract_xcode.py --- a/contrib/apple-sdk-tools/extract_xcode.py +++ b/contrib/apple-sdk-tools/extract_xcode.py @@ -7,6 +7,7 @@ """ import argparse +import os.path import sys import struct import zlib @@ -54,6 +55,10 @@ args = parser.parse_args() + if os.path.exists(args.outfile): + print(f"Error: Output file {args.outfile} already exists.", file=sys.stderr) + sys.exit(1) + with io_wrapper(args.file, "rb") as infile, io_wrapper(args.outfile, "wb") as outfile: start_offset = 0