# OpcFileInfo Class

> Reference: Provides properties and instance methods for the opening of files and aids in the creation of OpcFileStream objects.

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcFileInfo Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Provides properties and instance methods for the opening of files and aids in the creation of [OpcFileStream](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilestream/) objects.

## Syntax

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

```csharp
public sealed class OpcFileInfo
```

</div>

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

```vbnet
Public NotInheritable Class OpcFileInfo
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → **OpcFileInfo**

## Constructors

| Name | Description |
|---|---|
| [OpcFileInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#opcfileinfo)<span class="api-meta">2 overloads</span> | Initializes a new instance of the OpcFileInfo class, which acts as a wrapper for the file node identified by the `context` specified. |

## Properties

| Name | Description |
|---|---|
| [CanUserWrite](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#canuserwrite) | Gets a value indicating whether the file is writable taking user access rights into account. |
| [CanWrite](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#canwrite) | Gets a value indicating whether the file is writable. |
| [Context](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#context) | Gets the [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) used to wrap and access the file node its information is to be provided by the OpcFileInfo. |
| [Exists](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#exists) | Gets a value indicating whether the file node represented exists. |
| [Length](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#length) | Gets the size, in bytes, of the current file represented by the file node described. |
| [MimeType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#mimetype) | Gets the media type of the current file represented by the file node described. |
| [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#name) | Gets the name of the file node described. |

## Methods

| Name | Description |
|---|---|
| [AppendText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#appendtext) | Creates a [StreamWriter](https://learn.microsoft.com/dotnet/api/system.io.streamwriter) that appends text to the file represented by this instance of the OpcFileInfo. |
| [Open](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#open) | Opens a file in the specified `mode`. |
| [OpenRead](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#openread) | Creates a read-only [OpcFileStream](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilestream/). |
| [OpenText](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#opentext) | Creates a [StreamReader](https://learn.microsoft.com/dotnet/api/system.io.streamreader) with UTF8 encoding. |
| [OpenWrite](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#openwrite) | Creates a write-only [OpcFileStream](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilestream/). |
| [Refresh](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#refresh) | Refreshes the state and information of the OpcFileInfo object. |
| [ToString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfileinfo/members#tostring)<span class="api-meta">override</span> | Returns the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) or the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#value) of the file node described. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
