Crosswords0 min ago
Putting an extension on a filename
2 Answers
Why does putting an extension like like .jpg or .doc make the file suddenly readable if it hadn't been before? Why doesn't the computer know what it is if a paint program, for example, saves a file only as 'picture' and not 'picture.jpg'
Answers
Best Answer
No best answer has yet been selected by marmaduke. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.Microsoft use file extensions so they can associate different file types with different applications. For instance document.doc is associated with Word as .doc files will cause Word to open. If I had simply document you would need to go through all applications you have installed on your PC to view it.
The computer _ought_ to be able to tell what kind of file it is without an extension, because lots of different file type definitions require a few bytes early in the file to say what kind of file it is. (An obvious example is <HTML> at the beginning of a web page.) Sadly, this subtlety seems to have escaped Microsoft.