Fuse cannot open and read compressed disk images and multiple compressed tapes etc.
In libspectrum `libspectrum_identify_file_with_class()` do recursive uncompression, so identify multiple compressed files (eg: chasehq.dsk.gz.gz, or Chaos.tzx.gz.gz).
In libspectrum `libspectrum_tape_read()` do only one level uncompression, so if we start fuse e.g.:
fuse Chaos.tzx.gz.gz
Fuse identify TZX and try to load the tape, but do only one level uncompression, so fail with this error: `libspectrum: libspectrum_tzx_create: wrong signature`
utils_open_file() identify the given file recursively (with libspectrum_identify_file_with_class() ) and pass the original buffer and the "last" type of file...
we never free the old buffers when do `libspectrum_identify_file_with_class()`, so while we opening compressed files, Fuse just eating (and leaking) memory
This patch(es) does:
libspectrum:
- move `libspectrum_uncompress_file()` into public
fuse:
- add a new function: utils_read_file_mode() wich can open files in different ways:
- read just the plain file
- read plain file and identify
- read, recursively uncompress and identify
- read, recursively uncompress, identify and give back the new filename (which related to the uncompressed buffer data)
- utils_read_file() now call `utils_read_file_mode()` with uncompress and identify mode
- utils_open_file() now pass the uncompressed and identified buffer to tape_read_buffer() and others...