2018-11-03 12:29:47 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import argparse
|
2018-11-06 00:38:59 +00:00
|
|
|
from machfs import Volume
|
2022-09-01 12:20:32 +00:00
|
|
|
import os
|
2018-11-03 12:29:47 +00:00
|
|
|
|
|
|
|
args = argparse.ArgumentParser()
|
|
|
|
|
|
|
|
args.add_argument('src', metavar='INPUT', nargs=1, help='Disk image')
|
|
|
|
args.add_argument('dir', metavar='OUTPUT', nargs=1, help='Destination folder')
|
|
|
|
|
|
|
|
args = args.parse_args()
|
|
|
|
|
2022-09-01 12:20:32 +00:00
|
|
|
try:
|
|
|
|
os.mkdir(args.dir[0])
|
|
|
|
except FileExistsError:
|
|
|
|
pass
|
|
|
|
|
2018-11-03 12:29:47 +00:00
|
|
|
with open(args.src[0], 'rb') as f:
|
|
|
|
v = Volume()
|
|
|
|
v.read(f.read())
|
|
|
|
|
2018-11-06 00:38:59 +00:00
|
|
|
v.write_folder(args.dir[0])
|