# Read the properties of given files

Acquire / filesystem

A variant of [List files and folders](https://meridian.online/operations/list-files-and-folders).

Look up size, timestamps and other metadata for files whose paths are already known.

Page: <https://meridian.online/operations/list-files-and-folders/read-file-properties>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today.

## The DuckDB step

look up the size and modified time of files whose paths are known

It reads the `orders` table the proofs share. Create it first:

```sql
CREATE TABLE orders AS SELECT * FROM (VALUES
  (1,  'Alice Ng',      'north', DATE '2026-01-03', 120.00, 'widget', 'a|b',   '{"channel":"web","items":[1,2]}'),
  (2,  'alice ng',      'north', DATE '2026-01-05',  80.50, 'gadget', 'b',     '{"channel":"shop","items":[3]}'),
  (3,  'Bob  Okafor',   'south', DATE '2026-01-05', 300.00, 'widget', 'a|c',   '{"channel":"web","items":[4,5,6]}'),
  (4,  'Carla Díaz',    'east',  DATE '2026-01-09',  NULL,  'gizmo',  NULL,    '{"channel":"web","items":[]}'),
  (5,  'Bob Okafor',    'south', DATE '2026-01-12',  45.25, 'gadget', 'c',     '{"channel":"phone","items":[7]}'),
  (6,  'Dev Patel',     'west',  DATE '2026-01-12', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (7,  'Carla Diaz',    'east',  DATE '2026-01-20',  99.99, 'gizmo',  'b|c',   '{"channel":"shop","items":[10]}'),
  (8,  'Dev Patel',     'west',  DATE '2026-02-02', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (9,  'Eve Larsen',    NULL,    DATE '2026-02-03',  15.00, 'gadget', NULL,    '{"channel":"web","items":[11]}'),
  (10, 'Alice Ng',      'north', DATE '2026-02-10', 220.00, 'gizmo',  'a|b|c', '{"channel":"phone","items":[12,13]}')
) t(order_id, customer, region, order_date, amount, product, tags, meta);
```

Then run the statement:

```sql
COPY (SELECT * FROM orders) TO '<your_scratch_dir>/known_a.csv' (HEADER);
COPY (SELECT order_id FROM orders) TO '<your_scratch_dir>/known_b.csv' (HEADER);
COPY (SELECT 1) TO '<your_scratch_dir>/known_c.csv';
CREATE TEMP TABLE result AS
SELECT replace(f.filename, '<your_scratch_dir>/', '') AS file, f.size, f.last_modified >= now() - INTERVAL 1 HOUR AS recent
FROM read_blob(['<your_scratch_dir>/known_a.csv', '<your_scratch_dir>/known_b.csv']) f;  -- the named files only; known_c.csv is in the folder and not listed
SELECT * FROM result ORDER BY file;
SELECT CASE WHEN ((SELECT list(file ORDER BY file) FROM result) = ['known_a.csv', 'known_b.csv'] AND (SELECT bool_and(recent) FROM result) AND (SELECT size FROM result WHERE file = 'known_b.csv') = 30 AND (SELECT size FROM result WHERE file = 'known_a.csv') > (SELECT size FROM result WHERE file = 'known_b.csv')) THEN 'as expected' ELSE error('the two named files did not come back with their sizes and a recent modified time') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

The statement writes `known_a.csv`, `known_b.csv` and `known_c.csv` itself, in `<your_scratch_dir>`.

It needs nothing installed beyond DuckDB itself.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- Azure Data Factory: [`Get Metadata`](https://learn.microsoft.com/en-us/azure/data-factory/control-flow-get-metadata-activity) (read 2026-09-27)
- KNIME Analytics Platform: [`Files/Folders Meta Info`](https://api.hub.knime.com/nodes/*dUVBjt2bvzd7_asN?details=full) (read 2026-09-27)
- Talend: [`tFileProperties`](https://help.qlik.com/talend/en-US/components/8.0/tfileproperties/tfileproperties-component) (read 2026-09-27)
