From 4db5dd38192b694d5d9dde309216c0e8c3951863 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Thu, 1 Sep 2022 20:20:32 +0800 Subject: [PATCH] DumpHFS: create nonexistent dest dir --- bin/DumpHFS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/DumpHFS b/bin/DumpHFS index d148021..beef46d 100755 --- a/bin/DumpHFS +++ b/bin/DumpHFS @@ -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())