OpcFileInfo Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcFileInfo type exposes the following members.

OpcFileInfo(FileInfo)

Initializes a new instance of the OpcFileInfo class with the FileInfo to use as the underlyingFileInfo.

C#

public OpcFileInfo(FileInfo underlyingFileInfo)


Parameters

underlyingFileInfo FileInfo

The underlying FileInfo to use.


Exceptions

ArgumentNullException

The underlyingFileInfo is a null reference (Nothing in Visual Basic).

OpcFileInfo(String)

Initializes a new instance of the OpcFileInfo class with the filePath specified.

C#

public OpcFileInfo(string filePath)


Parameters

filePath String

The fully qualified path or the relative path to the file to represent.

Exists

Gets a value indicating whether a file exists.

C#

public bool Exists { get; }


Property Value

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.

C#

public virtual bool IsReadOnly { get; }


Property Value

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.

C#

public long Length { get; }


Property Value

Int64

The size of the current file in bytes.

UnderlyingFileInfo

Gets the underlying FileInfo used by the current OpcFileInfo.

C#

public FileInfo UnderlyingFileInfo { get; }


Property Value

FileInfo

The instance of the FileInfo class used by the current OpcFileInfo.

GetMimeType()

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

C#

public string GetMimeType()


Returns

String

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

Open(OpcFileMode)

Opens a file in the specified mode.

C#

public virtual Stream Open(OpcFileMode mode)


Parameters

mode OpcFileMode

A OpcFileMode value specifying the mode in which to open the file.


Returns

Stream

A file opened in the specified mode.



Exceptions

ArgumentException

The file mode specified is invalid.

OpenCore(FileMode, FileAccess, FileShare)

Opens the underlying file info with the specified mode, access, and share.

C#

protected virtual Stream OpenCore(FileMode fileMode, FileAccess fileAccess, FileShare fileShare)


Parameters

fileMode FileMode

A FileMode constant specifying the mode (for example, Open or Append) in which to open the file.

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

Stream

A FileStream object opened with the specified mode, access, and sharing options.

Refresh()

Refreshes the state of the object.

C#

public void Refresh()



Exceptions

IOException

A device such as a disk drive is not ready.