---
title: "Drive.File"
slug: "drivefile"
updated: 2026-06-29T12:52:07Z
published: 2026-06-29T12:52:07Z
canonical: "support.lusid.com/drivefile"
---

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

# Drive.File

| Type | Read/write | Author | Availability |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider#data-provider) | Write | FINBOURNE | Provided with LUSID |

The `Drive.File` provider enables you to write a [Luminesce query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that searches for a particular file or files stored in [Drive](/v1/docs/drive).

The query returns a table of data if matching files are found, which you can use in preparation for extracting data from those files.

**See also:** [Drive.Excel](/v1/docs/driveexcel), [Drive.Csv](/v1/docs/drivecsv), [Drive.Sqlite](/v1/docs/drivesqlite), [Drive.SaveAs](/v1/docs/drivesaveas)

## Basic usage

```sql
select * from Drive.File where <filter-expression>;
```

## Query parameters

`Drive.File` has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Drive.File' and FieldType = 'Parameter';
```

## Data fields

By default, `Drive.File` returns a table of data populated with particular fields (columns). You can return just a subset of these fields if you wish.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Drive.File' and FieldType = 'Column';
```

> [!NOTE]
> **Note:** Fields marked 'main' are returned by queries that start select ^ from Drive.File...

## Examples

> [!NOTE]
> **Note:** For more examples, try the [Luminesce Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples/drive).

### Example 1: List the files and folders in the root Drive directory

```sql
select * from Drive.File
```

### Example 2: List all the files and folders in a particular folder

```sql
select * from Drive.File where RootPath = 'trade-files'
```

### Example 3: List all the files and folders in a folder and its subfolders to a particular depth

```sql
select * from Drive.File where RootPath = 'trade-files' and RecurseDepth = 2
```

### Example 4: List all the files in a folder that have a similar name

```sql
select * from Drive.File where Name like 'trade-file-%-eod'
```
