Eli5 how does a file get corrupted? What is it that happens?

502 views

[ad_1]

Eli5 how does a file get corrupted? What is it that happens?

In: Technology
[ad_2]

Let’s take this analogy: you’re making a puzzle. You got the box to show you the image you have to make. You’re puzzling and puzzling, everything is going fine. Halfway through someone kicks your puzzle and some of the pieces (this could be any error happening with your pc). Later you want to see the image on the puzzle, only to realize it’s not finished. On top of that, you’re missing pieces. You could say your puzzle (the file) is corrupted.

Now what actually happens is that your pc tries to write a file to your hard drive. If that is being interrupted, it can’t write the file in its entirety to the disk, which causes the file to be incomplete and unreadable (thus corrupted). This can also happen while you’re updating windows for instance. While it’s installing the updates, it asks you not to turn off your pc (because that will disrupt the puzzling process). If your pc does shut down unexpectedly, the updates may not be installed properly, causing your OS (windows) to be corrupted.

Any file is long sequence of spot on the your hard drive that are magnetized (to represent one) or not magnetized (represents zero)

Sometimes magnetizing process goes wrong, or there is magnetic field from outside that puts the wrong number in there.

if the file was a text, it will create a typo-like mistake, or a weird character. A human who knows how to read can work around the typo, figuring out the meaning from the context. A computer cannot do that (computers work very differently from human brains).

In addition, many files contain “checksums”, i.e. way to verify if the file was corrupted or changed by a hacker. If this check fails, file is declared corrupted.