> The name of the directory inside could be either mnesia or mnesia-4.4.7 according to the Erlang manual.

Maybe the manual is inconsistent but I found [this quote](http://www.erlang.org/doc/man/code.html): "That is, a mnesia.ez archive must contain a mnesia top directory." If you find parts that contradicts this, we should ping the OTP team. :)

That said, I took at look around and it seems that [`:zip.create/3`](http://www.erlang.org/doc/man/zip.html#create-3) allows the filenames to be tuples representing the filename and the file contents. This gives us the flexibility of generating any name we want without a need to create a temporary directory. So I went ahead and did those changes on top of your changes! Now this local code is simple again! :D

Thank you for your work @jeremyjh !