The other way, which I personally take as a better way, is to make it truely OO. I see an Openner class, and two subclasses of this Openner class: PlainOpenner and ZippedOpener. Both PlainOpenner and ZippedOpenner has their own open method.
After you detect the type of the file, base on the type, either new a PlainOpenner or a ZippedOpenner. When you call open(), it would be resolved to the appropriate one.
Seems to me, this gives a better application structure.
excellent choice, but this is being grafted into an existing app, and with a go-live date 2 weeks away, refactoring the whole thing to OO would not be appreciated by some sections of the project. But if I had my time again, ...