# readFileInfo

Function

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/read.ts#L277

```ts
readFileInfo(readFileOptions: ReadFileOptions): Promise<FileInfo>
```

Read a splat file's structural metadata as efficiently as the format allows —
from the header alone wherever possible, without decoding gaussian data, and
across every LOD level.

`sog` is peeked from `meta.json` (no WebP decode) and `spz` from its 16-byte
header (no payload decode: gzip-wrapped v1-3 files inflate only enough of the
stream to reach the header); every other format opens via [readFile](https://api.playcanvas.com/splat-transform/functions/readFile.md)
(header-only for the lazy readers; eager for `ksplat`/`mjs`) and reads its
`meta`. For those, integrity is enforced by the readers, which throw on a size
mismatch, so a returned `FileInfo` implies a structurally sound file; the
`sog`/`spz` peeks validate the header but not the payload. A `FileInfo` doesn't
imply splat data either: a permissive container (e.g. a point-cloud PLY) reads
fine with `gaussian: false`. To test "is this a valid splat", check both: a
throw means unreadable, `gaussian` is the data verdict.

**Parameters**

- `readFileOptions` ([`ReadFileOptions`](https://api.playcanvas.com/splat-transform/types/ReadFileOptions.md)): Same inputs as [readFile](https://api.playcanvas.com/splat-transform/functions/readFile.md).

**Returns** `Promise<`[`FileInfo`](https://api.playcanvas.com/splat-transform/types/FileInfo.md)`>`: The file's [FileInfo](https://api.playcanvas.com/splat-transform/types/FileInfo.md).
