Reference
OpcFileInfo Members
Provides a default implementation of the IOpcFileInfo interface representing a FileInfo for the use in OPC UA.
Reference
OpcFileInfo Members
- Type
- OpcFileInfo
- Namespace
- Opc.UaFx
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
Constructors
OpcFileInfo
| Overload | Description |
|---|---|
| OpcFileInfo( | Initializes a new instance of the OpcFileInfo class with the filePath specified. |
| OpcFileInfo( | Initializes a new instance of the OpcFileInfo class with the FileInfo to use as the underlying. |
OpcFileInfo(string)
Initializes a new instance of the OpcFileInfo class with the filePath specified.
public OpcFileInfo(string filePath)Public Sub New(filePath As String)Parameters
| Name | Type | Description |
|---|---|---|
filePath | String | The fully qualified path or the relative path to the file to represent. |
OpcFileInfo(FileInfo)
Initializes a new instance of the OpcFileInfo class with the FileInfo to use as the underlyingFileInfo.
public OpcFileInfo(FileInfo underlyingFileInfo)Public Sub New(underlyingFileInfo As FileInfo)Parameters
| Name | Type | Description |
|---|---|---|
underlying | FileInfo | The underlying FileInfo to use. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The underlying is a null reference ( |
Properties
Exists
Gets a value indicating whether a file exists.
public bool Exists { get; }Public ReadOnly Property Exists As BooleanProperty value
The value true if the file exists; false if the file does not exist.
Implements
IsReadOnly
Gets or sets a value that determines if the current file is read only.
public virtual bool IsReadOnly { get; }Public Overridable ReadOnly Property IsReadOnly As BooleanProperty value
The value true if the current file is read only; otherwise the value false.
Implements
Length
Gets the size, in bytes, of the current file.
public long Length { get; }Public ReadOnly Property Length As LongProperty value
The size of the current file in bytes.
Implements
UnderlyingFileInfo
Gets the underlying FileInfo used by the current OpcFileInfo.
public FileInfo UnderlyingFileInfo { get; }Public ReadOnly Property UnderlyingFileInfo As FileInfoProperty value
The instance of the FileInfo class used by the current OpcFileInfo.
Methods
GetMimeType
Determines the internet media type (mime- or content-type) of the file.
public string GetMimeType()Public Function GetMimeType() As StringReturns
The type name according to the specification of multipurpose internet mail extensions (MIME) of the file represented.
Implements
Open
Opens a file in the specified mode.
public virtual Stream Open(OpcFileMode mode)Public Overridable Function Open(mode As OpcFileMode) As StreamParameters
| Name | Type | Description |
|---|---|---|
mode | OpcFileMode | A OpcFileMode value specifying the mode in which to open the file. |
Returns
A file opened in the specified mode.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The file mode specified is invalid. |
Implements
OpenCore
Opens the underlying file info with the specified mode, access, and share.
protected virtual Stream OpenCore(
FileMode fileMode,
FileAccess fileAccess,
FileShare fileShare)Protected Overridable Function OpenCore(
fileMode As FileMode,
fileAccess As FileAccess,
fileShare As FileShare) As StreamParameters
| Name | Type | Description |
|---|---|---|
fileMode | FileMode | A FileMode constant specifying the mode ( |
fileAccess | FileAccess | A FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access. |
fileShare | FileShare | A FileShare constant specifying the type of access other FileStream objects have to this file. |
Returns
A FileStream object opened with the specified mode, access, and sharing options.
Refresh
Refreshes the state of the object.
public void Refresh()Public Sub Refresh()Exceptions
| Exception | Condition |
|---|---|
| IOException | A device such as a disk drive is not ready. |
Implements

