4.3.6 MoveOrCopy

MoveOrCopy is used to move or copy a file or directory organized by this Object to another directory or to rename a file or directory.

Signature

	MoveOrCopy(
		 [in] NodeId 	objectToMoveOrCopy
		 [in] NodeId 	targetDirectory
		 [in] Boolean 	createCopy
		 [in] String 	newName
		 [out] NodeId 	newNodeId
		);
Argument Description
objectToMoveOrCopyThe NodeId of the file or directory to move or copy.
targetDirectoryThe NodeId of the target directory of the move or copy command. If the file or directory is just renamed, the targetDirectory matches the ObjectId passed to the method call.
createCopyA flag indicating if a copy of the file or directory should be created at the target directory.
newNameThe new name of the file or directory in the new location. If the string is empty, the name is unchanged.
newNodeIdThe NodeId of the moved or copied object. Even if the Object is moved, the Server may return a new NodeId.

Method Result Codes (defined in Call Service)

Result Code Description
Bad_BrowseNameDuplicatedSee OPC 10000-4 for a general description. A file or directory with the name already exists.
Bad_NotFoundSee OPC 10000-4 for a general description. A file or directory with the provided NodeId is not organized by this object.
Bad_InvalidStateSee OPC 10000-4 for a general description. The file or directory is locked and thus cannot be moved or copied.
Bad_UserAccessDeniedSee OPC 10000-4 for a general description.

Table 12 specifies the AddressSpace representation for the MoveOrCopy Method.

Table 12 – MoveOrCopy Method AddressSpace definition
Attribute Value
BrowseNameMoveOrCopy
References NodeClass BrowseName DataType TypeDefinition ModellingRule
HasPropertyVariableInputArgumentsArgument[] PropertyTypeMandatory
HasPropertyVariableOutputArgumentsArgument[] PropertyTypeMandatory
Conformance Units
Base Info FileDirectoryType Base