I understand changes of file attaching in D7, but problem is, if I delete and re-upload changed file, the deleted file is still on server and re-uploaded filename gets changed. If I understand correctly, removed file is deleted by cron, so there is a delay. Is it possible to get file deleted in real time, to avoid renaming of uploaded one?
It is not possible. If files were deleted "in real time", node your readers see would have a link and reference to a file no longer on server's hdd.
If you need to get the same file name, remove file, save node, upload new version, save node. That way you will avoid both broken links and name conflicts.
If you have IMCE installed go to Home » Administration » Configuration » Media
and change IMCE common settings:
Default behaviour for existing files during file uploads
- Keep the existing file renaming the new one
- Keep the existing file rejecting the new one
- Replace the existing file with the new one
Hope this helps.