Algorithmic thinking: Checking for deleted files

Source: Internet
Author: User
Tags tmp file

For each file, the file name extension should indicate a file type, such as

. jpg indicates that this is a JPG file that can be verified in the format of the JPG file;

But often, for example, from a Web application, like to mess up an extension, such as

. tmp. DAT, etc., although it may be a JPG file, but it can not be verified according to the extension;

This is a dilemma:

1, if regardless of file extension, directly according to the file header to determine the file type, this is a check method;

But

2, if the. tmp file is deleted, its location is just another JPG file (if the jpg file is also deleted), then the confusion of the two files, to restore the JPG file is difficult.

How should I choose a recovery algorithm?

Perhaps should not consider the 2, only according to one to do, the probability of success is greater, far greater than the consideration of 2.

Algorithmic thinking: Checking for deleted files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.