If the method succeeds, the return value is the length of
the file or directory path, not including the terminating null
character. If the
client ID does not specify a valid client session,
the method will return zero. If the client has not renamed a file or
directory, this method will return zero.
When a client wishes to rename a file or directory, it must send
two commands in sequence to the server. The first command is RNFR
(rename from) which specifies the original name of the file or
directory to be renamed. The second command is RNTO (rename to) and
must be sent immediately after the RNFR command and specifies the new
name for the file or directory. The GetRenamedFile method
will return the full path of the local file or directory that was
specified by the RNFR command. Typically this method is used by an
event handler that processes the OnCommand event to determine
the original path name.
This method is only guaranteed to return a meaningful value when
called within the context of the OnCommand event handler. Calling this
method outside of the event handler will return the path of the last
renamed file, but there is no way to determine at what point the
client issued the command to rename a file or directory. To obtain the
new file or directory name, the GetCommandFile method
should be called from within the event handler.
The RNFR and RNTO commands can also be used to move a file or directory to a new
location. For example, they could be used to move a file from one
directory to another. An application should never make the assumption
that the paths of the original and new file will be the same.