TApxProtocol.WriteFailAction

TApxProtocol

property WriteFailAction : TApxWriteFailAction
TApxWriteFailAction = (wfWriteNone, wfWriteFail,
wfWriteRename, wfWriteAnyway, wfWriteResume);

Default: wfWriteRename

Determines the receiver's behavior when the destination file already exists.

You should assign one of the following values to WriteFailAction:

Value
Description
wfWriteFail
Fail the receive attempt
wfWriteRename
Rename the incoming file
wfWriteAnyway
Overwrite the existing file

When wfWriteRename is selected and the destination file already exists, the first character in the incoming file name is replaced with '$' (e.g., "SAMPLE.DOC" becomes "$AMPLE.DOC"). If that renamed file already exists, it is overwritten without warning.

The logic that handles these overwrite options is executed after the OnProtocolAccept event has been generated. If you write an event handler that deals with possible overwrites, be sure to set WriteFailAction to wfWriteAnyway before starting a transfer.

See also: OnProtocolAccept, ZmodemFileOption