Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to read from gzip or zip files #8

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

a2geek
Copy link
Contributor

@a2geek a2geek commented Nov 2, 2020

I have a number of disk images that are in an archive, and it gets annoying to decompress them. So, after a quick bit of 'googling', I saw that it was relatively simple to identify file types.

This PR adds the ability to load a disk "still" in gzip or zip format. For the zip file, I reused the isFile*(...) methods to locate the first disk image in the archive.

After adding the code, I realized that LoadResource(...) is used in multiple locations to load any remote resource. If you think that may be a problem (or this should be restructured), please let me know!

@ivanizag
Copy link
Owner

ivanizag commented Nov 3, 2020

With this implementation a compressed DSK file is writable, but writes won't work. fileNib.saveTrack() doesn't know that the file is compressed, so it writes uncompressed tracks on the zip file.

The solution may be to set d.nib.supportsWrite to false in LoadDiskette(). We would need LoadResource() to return also if the resource is writable or not.

@a2geek
Copy link
Contributor Author

a2geek commented Nov 3, 2020

First draft setting a writeable flag. I didn't notice anything specific in the disk images (no outright error). But the changes did not persist. I am uncertain what the behavior was before, so hopefully this is the right direction!

@ivanizag
Copy link
Owner

ivanizag commented Nov 3, 2020

Yes, that's it. Now the zip file is not modified.

Thanks!

@ivanizag ivanizag merged commit 313733b into ivanizag:master Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants