There are a few techniques that you can use depending on your circumstances.
First, you can use the XLRSetWriteProtect function which will disable the use of any functions that alter the data on the system. The write protection must be explicitly cleared using the XLRClearWriteProtect function. The write protection status is saved with the disk set so it will stay set after power cycles or removal and re-insertion of a disk set if you are using removable media.
Another technique is to always use the XLRAppend function to start a recording. This function can start a recording even if the disk set is empty. Unlike the XLRRecord function it will never overwrite any existing data. The XLRErase function can be used to explicitly request all existing data to be erased. Obviously you should always confirm when an erase is requested in your user interface.
The last alternative is to never allow a new recording to be started without an explicit choice by the user to erase the existing recording. Instead of allowing the user to select record directly when data is present on the device, force the user to execute an explicit erase first so that the user is completely aware that existing data is being erased. This will usually cause the user to consider whether the existing data is important.