---
id: "P:cAlgo.API.File.Size"
kind: "property"
type: "T:cAlgo.API.File"
url: "https://help.ctrader.com/ctrader-algo/references/Utility/File/Size/"
---

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

# File.Size

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

## Size

Gets file size in bytes.

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

- Cloud: Throws InvalidOperationException 'Getting file info is not supported in cloud environment.'

C#:

```csharp
long Size {get;}
```

Python:

```python
file.Size: int
```

### Returns

`long` — 

Available since cAlgo.API 5.7.

### Examples

C#:

```csharp
protected override void OnStart()
{
    Print("{0} size: {1} KB", DataFile.Name, DataFile.Size / 1024.0);
}
```

Python:

```python
api.Print(f"{api.DataFile.Name} size: {api.DataFile.Size / 1024.0} KB")
```

config.json:

```json
{
  "Parameters": [
    {
      "Name": "DataFile",
      "DisplayName": "Data File",
      "Type": "File"
    }
  ]
}
```

