How to find reason for failed RenameFile()?
Posted: Mon Jun 25, 2012 10:29 am
Hi,
I want to move files using RenameFile() from network share with virus scanner to local share. If the virus scanner catches the file, I want to know it (to give user information). But RenameFile() is only saying Yes or No.
But there are many possible reasons for failure. I need to know if it has been because of:
- ERROR_FILE_NOT_FOUND
- ERROR_ACCESS_DENIED
- ERROR_INVALID_DRIVE
- ERROR_NOT_READY
- ERROR_READ_FAULT
- ERROR_VIRUS_INFECTED
- ERROR_VIRUS_DELETED
Any idea how to get this return codes without the need to use API (cross plattform)? Something like GetLastIOError() function?
Kukulkan
I want to move files using RenameFile() from network share with virus scanner to local share. If the virus scanner catches the file, I want to know it (to give user information). But RenameFile() is only saying Yes or No.
But there are many possible reasons for failure. I need to know if it has been because of:
- ERROR_FILE_NOT_FOUND
- ERROR_ACCESS_DENIED
- ERROR_INVALID_DRIVE
- ERROR_NOT_READY
- ERROR_READ_FAULT
- ERROR_VIRUS_INFECTED
- ERROR_VIRUS_DELETED
Any idea how to get this return codes without the need to use API (cross plattform)? Something like GetLastIOError() function?
Kukulkan