>>5 It probably tried opening the same file for both reading and writing, as separate file handles. That sort of thing is not wise....
Perhaps zcat was what you were after?
zcat
$ zcat < YKK.kmz > YKK.kmz.decompressed$ mv YKK.kmz{.uncompressed,}