# IOpcFileInfo Members

> Reference: Represents a single file in OPC UA and provides properties and instance methods for accessing files.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcFileInfo</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Properties

### Exists

Gets a value indicating whether a file exists.

<div class="api-signature" data-lang="csharp">

```csharp
bool Exists { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Exists As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the file exists; false if the file does not exist.

### IsReadOnly

Gets or sets a value that determines if the current file is read only.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsReadOnly { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsReadOnly As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current file is read only; otherwise the value false.

### Length

Gets the size, in bytes, of the current file.

<div class="api-signature" data-lang="csharp">

```csharp
long Length { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Length As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The size of the current file in bytes.

## Methods

### GetMimeType

Determines the internet media type (mime- or content-type) of the file.

<div class="api-signature" data-lang="csharp">

```csharp
string GetMimeType()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetMimeType() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The type name according to the specification of multipurpose internet mail extensions (MIME) of the file represented.

### Open

Opens a file in the specified mode.

<div class="api-signature" data-lang="csharp">

```csharp
Stream Open(OpcFileMode mode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function Open(mode As OpcFileMode) As Stream
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | A [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) value specifying the mode in which to open the file. |

**Returns**

[Stream](https://learn.microsoft.com/dotnet/api/system.io.stream)

A file opened in the specified mode.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The file `mode` specified is invalid. |

### Refresh

Refreshes the state of the object.

<div class="api-signature" data-lang="csharp">

```csharp
void Refresh()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Sub Refresh()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [IOException](https://learn.microsoft.com/dotnet/api/system.io.ioexception) | A device such as a disk drive is not ready. |
