pub fn sniff_format(path: &Path) -> Option<FileFormat>Expand description
What a file with no usable extension turns out to be, from the bytes at its start.
Every format datui reads as a directory puts a fixed signature at the front — Parquet at both ends, and the other three at the front alone. A name is the cheap answer and the one every listing uses; this is the expensive one, and it is asked only of a directory somebody is opening, never of a directory somebody is looking at.
Spark and GBIF both write part files with no extension — occurrence.parquet/000001
is read by its directory’s name, and the same files under a directory named anything
else were not data at all as far as datui was concerned.
CSV and JSON are deliberately absent: they have no signature, and guessing from the
first line is a parse rather than a look. Which signatures a listing believes is each
format’s to say ([crate::readers::Trusted::listing]).