zZIDRename

Renames the file object designated by the specified ZID.

Service:File System Services (64-Bit)
Version:OES 2

Syntax

#include <zPublics.h>

STATUS zZIDRename(
   Key_t        key,
   Xid_t        xid,
   VolumeID_t  *srcVolumeID,
   Zid_t        srcZid,
   Zid_t        dstZid,
   NINT         dstNameSpace,
   const void  *dstPath,
   NINT         renameFlags);

Parameters

key

(IN) Specifies who is renaming the file. If the volume ID is not supplied, the key identifies which volume to use. If the destination path is a relative path, the key is used to find the starting directory.

xid

(IN) Specifies that any deletes that are part of the given transaction are not completed until the transaction is committed. For no transaction, set to zNILXID.

srcVolumeID

(IN) Points to the GUID of the volume on which to search for the ZID. If NULL, the key parameter is used to identify the volume.

srcZid

(IN) Specifies the ZID of the file to be opened.

destZid

(IN) Specifies the ZID for the renamed file.

dstNameSpace

(IN) Specifies the starting namespace for the path parameter.

In addition to the normal namespace identifiers (zNSPACE_DOS | zNSPACE_MAC | zNSPACE_UNIX | zNSPACE_LONG | zNSPACE_DATA_STREAM | zNSPACE_EXTENDED_ATTRIBUTE), nameSpace can be augmented by ORing the following mode bits:

  • zMODE_UTF8

    The default character set for the path is Unicode. However, by ORing zMODE_UTF8, UTF-8 character strings can be used.

  • zMODE_LINK

    If the last name in the path is a symbolic link, a junction, or a URL link, the scanning does not follow the link but acts on the link object itself.

dstPath

(IN) Specifies the target path and name of the file objects. This path must resolve to a directory file that exists, and it must also contain a leaf (link) name which does not yet exist. A major restriction on this path is that the target directory must reside in the same volume as the source directory. The default character set for the pathname is Unicode (unless modified by the dstNameSpace parameter). Cannot be NULL.

renameFlags

(IN) Specifies a bit mask that identifies specific modes with the rename function as follows:

zRENAME_ALLOW_RENAMES_TO_MYSELF

Allows a file to be named to its same place without getting an error message.

zRENAME_THIS_NAME_SPACE_ONLY

Specifies that the source and destination namespaces must be the same.

Return Values

zOK

The operation completed successfully.

non-0

An error occurred (see Section 4.1, Return Values for a description).

Remarks

zZIDRename works only with files and directories. It does not work with extended attributes or data streams.

See Also

zRename, zZIDDelete, zZIDDelete2, zZIDOpen