> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# storage.getFileStats()

> Public low-code contract, signatures and examples for storage.getFileStats.

## `storage.getFileStats()`

Builds reusable record or worksheet indexes and returns file statistics.

Notes:

* mode: "lines" builds a separate physical-line index with lineCount, map, batches, encoding and separator.
* CSV stats include physicalLineCount, blankLineCount and endsWithRecordDelimiter independently of logical rowCount.
* CSV dialect options include encoding, delimiter, recordDelimiter, headerRow, quote and escape. quote: false disables quoting and ignores escape.
* maxRecordBytes defaults to 64 MiB per logical record, independently of batch size. Invalid syntax or oversized records reject indexing with STORAGE\_CSV\_INVALID. Wrong source field counts reject by default; onError: "skipRow" skips them with csvReport diagnostics.
* The error contains errorCount, at most 100 location diagnostics and diagnosticsTruncated, never raw rows/cells; RecordTooLarge may report only the inspected prefix.
* physicalLineCount counts actual lines including headers, blank lines and multiline fields. Legacy lineCount retains the synthetic terminal empty line when present.
* Derived stats are cached on the storage entry metadata for later batch reads.

### Overloads

```ts theme={null}
static getFileStats(
      storageEntryId: string,
      options?: StorageFileStatsOptions,
    ): Promise<StorageFileStats>;

static getFileStats(
      namespace: string,
      storageEntryId: string,
      options?: StorageFileStatsOptions,
    ): Promise<StorageFileStats>;
```

### Example

```ts theme={null}
const stats = await storage.getFileStats(storageEntryId, {
  separator: '\n',
  batchSize: 5000,
});
```

See [all storage methods](https://docs.revoengine.com/low-code/reference/storage.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.