---
id: "P:cAlgo.API.FileAssociationsFileOpenedEventArgs.FilePath"
kind: "property"
type: "T:cAlgo.API.FileAssociationsFileOpenedEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/FileAssociationsFileOpenedEventArgs/FilePath/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# FileAssociationsFileOpenedEventArgs.FilePath

Member of [FileAssociationsFileOpenedEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/FileAssociationsFileOpenedEventArgs/index.md).

## FilePath

Gets opened file path.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public string FilePath {get;}
```

Python:

```python
fileAssociationsFileOpenedEventArgs.FilePath: str
```

### Returns

`string` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
protected override void OnStart()
{
    FileAssociations.Add("csv");
    FileAssociations.FileOpened += OnFileOpened;
}

private void OnFileOpened(FileAssociationsFileOpenedEventArgs args)
{
    if (args.FilePath.EndsWith(".csv", StringComparison.OrdinalIgnoreCase))
        Print("Importing {0}", args.FilePath);
}
```

Python:

```python
def on_start(self):
    api.FileAssociations.Add("csv")
    api.FileAssociations.FileOpened += self.on_file_opened

def on_file_opened(self, args):
    if args.FilePath.lower().endswith(".csv"):
        api.Print(f"Importing {args.FilePath}")
```

