Check the API DeleteFile for Windows. If you are using linux I am not sure about it.