guess mode by given file