Page 1 of 1

overwritten local files

Posted: 2020-01-13 14:57
by daisen
I've read another topics related to files erased downloading by mistake a file with the same name of other preexisting in local marchine or remote server.
Please, don't answer that the solution to my question is to have a daily backup. It's not my question.

My question is, if FileZilla erase the file when this occurs or if overwrite the sectors of disk.
Because I bought various kind of software to recover erased files but it seems FileZilla doesn't really erase the file. The overwritten file does not appear as an erased file.

The question is then, if filezilla erase the file so if it is possible to try to recover it using a software to that purpose.

If not, donĀ“t you think that is a problem considering there is no way to recover a file accidentally overwritten?

Thank you in advance

Re: overwritten local files

Posted: 2020-01-13 16:53
by boco
"Erasing" or "deleting" (excluding any delete sentry or recycle bin feature) a file means, in most OS, that the used clusters and the file system entry are simply being marked as free. Nothing is physically deleted, in the first place. That makes the files recoverable, at least on magnetic media where they are mostly stored sequentially.
"Overwriting" is nothing but a file erase, followed by creating a new file with the exact same path information. As file systems don't allow two files with the exact same path information/metadata, the old one gets lost. While the physical clusters might be still there until they get overwritten, you will need to scan for them, as the metadata is gone.

Deletion is, in neither case, handled by FileZilla, but by the local OS (server's OS for remote files). The exact implementation differs between OS, thus the behavior might be a little different as well. Example: Recycle bin is only used in the Windows version.

Possibility for recovering a file depends on multiple factors:
- Used OS and file system,
- special features like recycle bin,
- used media type, SSD might not allow recovery at all due to wear leveling, TRIM and other technologies,
- how much the media was used since deletion occurred, continued usage will eventually overwrite clusters,
- other factors like drive/file compression technologies,
- maybe even more...

It's a very complex topic.


Tl;dr - FileZilla asks the OS to delete files and directories, it doesn't do so by itself.

Re: overwritten local files

Posted: 2020-01-13 19:45
by daisen
Thank you for your answer...

but if FileZilla ask the operating system to perform an erase operation, why cant i see the erased file with programas like r-undelete, wordershare datarecovery or others.. like I see other deleted files (e.g. each time you open a MDF file, it creates an LDB file, and I can see tens of LDB files, with the same name)
As I said, expected to see the original file deleted.

The disk is not SSD, is a hard disk with no compression, with NTFS file system , and the SO is windows 8.

Re: overwritten local files

Posted: 2020-01-13 23:07
by boco
In Windows, deleted files first go to the Recycle Bin. Technically, they are moved and renamed, not deleted. Note that overwriting a file does not use the Recycle Bin, the old file is truly deleted.


Merely deleting a file from the file system should keep its directory entry intact (it gets a deletion marker). Recovery software can easily find those deleted directory entries and revert the delete action.

Overwriting removes all references to the old file. Clusters holding the old file's data are now orphaned, but they still exist. Recovery software needs to scan for these orphaned clusters, which only makes sense for plain text.

Re: overwritten local files

Posted: 2020-01-23 21:32
by daisen
Summarizing the case: i wasn't able to recover anything significant. Only by reading sectors unused of the disk but with a very hight time cost.
Evidently FileZille Doesn't perform a delete operation internally rather opens and re-write the same file.
It's a pitty given unexistence of "undo" function. It woul'd give the user a chance to recover a file accidentally downloaded.

Re: overwritten local files

Posted: 2020-01-24 01:37
by boco
Even if there was an Undo function, such Undo functions can not recover overwritten files. And file actions are done by the OS, not FileZilla.*
For a recovery action with a 100% chance, no data at all must be written to the volume after deletion of the old file. Overwriting is, OS internally, deletion followed by writing the new file. Simply writing the new file and its metadata usually destroys any chance of recovery. And that has nothing to do with FileZilla.

Having a valid backup of important data at all times is essential. Always, not only when using FileZilla.

*Example: Windows has an Undo system, CTRL+Z, as you probably know. Renaming files, accidentally moving files and some other actions can be undone. Overwriting a file in Windows can only be undone partially (the copy/move operation is undone), the overwritten target file gets lost.

Note that Windows introduced Recovery points and Previous files, at one point, that already is a simple backup system. But they are not entirely reliable and don't cover all files.