#!/usr/bin/env python3 """ UADF Virtual filesystem This extfs provides quick and dirty read-only access to disk image files for the Commodore Amiga adf or adz (gzipped adfs) and dms. It requires the unadf utility, unfortunately there is no original sources, since authors page doesn't exists anymore. Luckily, there is a copy of the source (and useful patches) in Debian repository: http://packages.debian.org/sid/unadf There should be one change made to the source of unadf, though. While using "-lr" switch it by default also displays comments, separated by the comma. However there is no way to distinguish where filename ends and comment starts, if comment or filename already contains any comma. The patched sources are available from: https://github.com/lclevy/ADFlib It also requires xdms utility, for optional dms support. Changelog: 1.3 Switch to Python3 1.2 Added failsafe for filenames in archive with spaces and nodos message. 1.1 Moved common code into extfslib library 1.0 Initial release Author: Roman 'gryf' Dobosz Date: 2019-06-30 Version: 1.3 Licence: BSD """ import sys import re import os import gzip from subprocess import check_output, check_call, CalledProcessError from tempfile import mkstemp, mkdtemp import shutil from extfslib import Archive, parse_args class UAdf(Archive): """ Class for interact with c1541 program and MC """ LINE_PAT = re.compile(b'\s*(?P\d+)?' b'\s{2}(?P\d{4}/\d{2}/\d{2})' b'\s{2}\s?(?P