IBM Support

RNM and MOV to Directory that Contains Objects results in confusing MSG Text

Troubleshooting


Problem

The Integrated File System (IFS) rename (RNM) and move (MOV) commands to a directory that contains objects results in message CPFA0AC with confusing text as to which directory contains objects.

Environment

IBM i OS V5R4 and Later

Diagnosing The Problem

If the RNM or MOV commands are used to rename or move a directory to a directory name that contains objects the message CPFA0AC that is returned contains text that is confusing. The first level message text will state that the original directory contains objects, even though it is empty.

Resolving The Problem

The IBM i OS IFS design makes this behavior normal, and the second level Cause text explains that it may be the destination directory that contains the objects.

For example, directory '/dirA' is empty, but '/dirC' contains a file. If the command RNM OBJ('/dirA') NEWOBJ('dirC') or MOV OBJ('/dirA') TODIR('/dirC') are run it will result in a message CPFA0AC:

"Directory contains objects. Directory is /dirA."

This is not correct at face value, because '/dirA' does not contain objects. The second level Cause text of the message CPFA0AC clarifies the situation further.

"Cause . . . . : An attempt was made to remove directory /dirA, while objects exist in it. Or an attempt was made to move or rename directory /dirA to a destination directory which exists and has objects in it."

The Recovery text lists the following that correctly addresses this situation:

"If you are attempting to move or rename a directory, you must first remove the destination directory and any objects in it. Use the DSPLNK command to view the list of objects in the directory."

This is considered sufficient and appropriate information for this situation and no changes are planned to the IBM i OS IFS in this situation.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Integrated File System","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
18 December 2019

UID

nas8N1021561