(TryOpen): use lazy evaluation for filename extension check.