mirror of
https://github.com/elliotnunn/machfs.git
synced 2024-12-27 01:32:20 +00:00
24 lines
448 B
Python
Executable File
24 lines
448 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
from machfs import Volume
|
|
import os
|
|
|
|
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()
|
|
|
|
try:
|
|
os.mkdir(args.dir[0])
|
|
except FileExistsError:
|
|
pass
|
|
|
|
with open(args.src[0], 'rb') as f:
|
|
v = Volume()
|
|
v.read(f.read())
|
|
|
|
v.write_folder(args.dir[0])
|