OpcFileOpenMethodNode.FileOpenExCallback Delegate

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll

Opens the file represented. When a client opens a file it gets a file handle that is valid while the session is open. Clients shall use the Close Method to release the file handle when they do not need access to the file anymore. Clients can open the same file several times for read.


public delegate uint FileOpenExCallback(OpcMethodContext context, [OpcArgument("Mode", Description = "A OpcFileMode value that determines whether the contents of existing files are retained or overwritten and how a file is accessed.")] byte mode);

Attributes CLSCompliantAttribute


context OpcMethodContext

The OpcMethodContext to use when opening the file. This instance will be also updated with the outcome of the method call.

mode Byte

Indicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set.



A handle for the file used in other method calls indicating not the file but the access request and thus the position in the file. The file handle is generated by the server and is unique for the Session. Clients cannot transfer the file handle to another Session but need to get a new file handle by calling the Open Method.


This method does provide the following OpcResult information: * BadNotReadableThe file might be locked and thus not readable. This is also the case there the file is already opened for writing by the current or a different session. * BadNotWritableThe mode refers to Write but neither 'CanWrite' nor 'CanUserWrite' grant write access. This is also the case there the file is already opened by the current or a different session. * BadInvalidStateThe file is locked and thus not writable. * BadInvalidArgumentThe mode configuration is invalid. * BadNotFoundThe file maintained by the file node does not exist. * BadUnexpectedErrorAn unexpected error occurred while opening the file.