Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcFileInfo type exposes the following members.
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
The underlyingFileInfo
is a null reference (Nothing in Visual Basic).
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.
Gets a value indicating whether a file exists.
C#
public bool Exists { get; }
Property Value
The value true if the file exists; false if the file does not exist.
Gets or sets a value that determines if the current file is read only.
C#
public virtual bool IsReadOnly { get; }
Property Value
The value true if the current file is read only; otherwise the value false.
Gets the size, in bytes, of the current file.
C#
public long Length { get; }
Property Value
The size of the current file in bytes.
Gets the underlying FileInfo used by the current OpcFileInfo.
C#
public FileInfo UnderlyingFileInfo { get; }
Property Value
The instance of the FileInfo class used by the current OpcFileInfo.
Determines the internet media type (mime- or content-type) of the file.
C#
public string GetMimeType()
Returns
The type name according to the specification of multipurpose internet mail extensions (MIME) of the file represented.
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
A file opened in the specified mode.
Exceptions
The file mode
specified is invalid.
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
A FileStream object opened with the specified mode, access, and sharing options.
Refreshes the state of the object.
C#
public void Refresh()
Exceptions
A device such as a disk drive is not ready.