DumpHFS: create nonexistent dest dir

This commit is contained in:
Elliot Nunn 2022-09-01 20:20:32 +08:00
parent 4d0927eb65
commit 4db5dd3819

View File

@ -2,6 +2,7 @@
import argparse
from machfs import Volume
import os
args = argparse.ArgumentParser()
@ -10,6 +11,11 @@ args.add_argument('dir', metavar='OUTPUT', nargs=1, help='Destination folder')
args = args.parse_args()
try:
os.mkdir(args.dir[0])
except FileExistsError:
pass
with open(args.src[0], 'rb') as f:
v = Volume()
v.read(f.read())