What do file extensions (exe, pdf, etc) actually do?

665 viewsOtherTechnology

What do file extensions (exe, pdf, etc) actually do?

In: Technology

12 Answers

Anonymous 0 Comments

They decide:

* what icon will be used for a file
* what text will appear in the “Type” column
* when you double-click a file – what action will be performed, which program will be started
* when you right-click – what options will appear on the list

Other than that – not much.

Your computer has a database of known extensions and all actions that can be performed on them. When you install a program that can open some type of file – it usually adds itself to the database.

The programs that actually open the file usually try to not depend on the extension – they usually search for “magic numbers” inside the file to determine the type. That’s why Paint can open a PNG file, even if you change the extension. However, some types have no magic numbers – so the program can still resort to using the extension.

Some programs can open any file, no matter the type. Notepad is one – it will try to decode the file as text, even if it isn’t one. Hex editors are specifically designed to view and modify the binary content of a file.

You are viewing 1 out of 12 answers, click here to view all answers.