RENAME: Rename File

The rename file message is sent to change the name of a file.

Client Request
==================================
Description
=================================
UCHAR WordCount; Count of parameter words = 1
USHORT SearchAttributes; Target file attributes
USHORT ByteCount; Count of data bytes; min = 4
UCHAR BufferFormat1; 0x04
STRING OldFileName[]; Old file name
UCHAR BufferFormat2; 0x04
STRING NewFileName[]; New file name

Files OldFileName must exist and NewFileName must not. Both pathnames must be relative to the Tid specified in the request. Open files may be renamed.

Multiple files may be renamed in response to a single request as Rename File supports wildcards in the file name (last component of the pathname).

SearchAttributes indicates the attributes that the target file(s) must have. If SearchAttributes is zero then only normal files are renamed. If the system file or hidden attributes are specified then the rename is inclusive -both the specified type(s) of files and normal files are renamed. The encoding of SearchAttributes is described in section 3.10 - File Attribute Encoding.

Server Response
==================================
Description
=================================
UCHAR WordCount; Count of parameter words = 0
USHORT ByteCount; Count of data bytes = 0

Errors

ERRDOS/ERRbadpath
ERRDOS/ERRbadfile
ERRDOS/ERRnoaccess
ERRDOS/ERRdiffdevice
ERRHRD/ERRnowrite
ERRSRV/ERRaccess
ERRSRV/ERRinvdevice
ERRSRV/ERRinvid
ERRSRV/ERRbaduid