That’s about right, with one caveat: the current behavior actually creates a blank file if it can’t find one. I don’t really understand the benefit of doing that, but I made sure to keep that the same in my patch. If it cannot find either an uncompressed or compressed file, it makes a new blank file with the “.txt” ending.
If you want to compress individual files into ZIPs, I could easily implement support for that by just replicating my existing code and replacing GZIPInputStream with ZipInputStream. However, multi-file ZIPs would cause undefined behavior, so I feel it is probably best to hold off on that until we decide how to deal with it.
It might be best to eventually make a separate class with functions for reading and writing compressed/archived files, rather than cluttering RuntimeLibrary with a bunch of control structures for every format. That isn’t necessary right now, though.