text should be one single character string
just let it fail if `file` is not specified and `text` is not character