Archive for September, 2009

Deleting a file/directory

How do you delete a file or directory1 in Win32/64 ? You have primarily three options – DeleteFile, RemoveDirectory MoveFileEx (…, MOVEFILE_DELAY_UNTIL_REBOOT…) CreateFile (…, FILE_FLAG_DELETE_ON_CLOSE…)  followed by CloseHandle First of all DeleteFile cannot be used to delete a directory, you are supposed to use RemoveDirectory instead. If you pass a directory path to DeleteFile, the [...]