DeleteFile Method
Deletes a file by passing the request directly to the filesystem.
Syntax
int DeleteFile(const QString& qsFileName, bool bCloseOpenHandles);
Remarks
This method should be used instead of the Windows API's DeleteFile function to delete the file specified by FileName when some other process has it open exclusively, or when the application doesn't have sufficient security rights/permissions to access it in a "standard" way.
If CloseOpenHandles is true, this method closes and invalidates all opened handles to the file before deleting it.
Error Handling
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)