some file format detection without using libfile or file.