Question

This is a theoretical question. This could be accomplished in any language but I am using python at the moment. I want to make a zip archive that will to expand to a rather large amount of repeating data. Is it possible to create a zip file that will expand to a predictable number of characters? For instance, if I zip file that will expand to foo.txt and contain the data aaaaaaaa, how difficult would it be to modify it so the resulting foo.txt will contain 10 letter a's, or more? Can this be accomplished in python without any external libraries?

Était-ce utile?

La solution

Look to the implementation of zipstream, specifically, zip_file. I believe you a can quickly modify the code there to generate a file that's roughly what you're looking for.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top