File extension

From MobileRead
Jump to: navigation, search

The file extension or more properly filename extension is a group of letters that are added to the end of the base filename of a computer file. They are normally separated from the basename with a dot (.).


[edit] Object oriented interface

Adding an extension to the filename is useful to help the user recognize the type of file that they are viewing and can be used to help identify the program that would be suitable to work with that file. While this can serve as a visual clue for the user it can also be used by a computer or even an eBook reader to automatically start a suitable program to read the file. In the Windows operating system the file extension is used in both the GUI and command line interface to find the correct program to start. In this method the file extension is directly related to the format of the file. Note that file extensions do not dictate the format of the file and using the wrong extension can cause an error when when a program attempts to read the file.

The file extension serves the purpose of metadata is showing the file type to the user.

[edit] Windows Object interface

Normally Windows will launch the right program but if it doesn't you can correct it. If you want to just launch a different program once then right click and select the program from the menu. If you want to set the program to launch:

  1. Open any file browser window
  2. Select Folder options from the tools menu choice at the top of the window.
  3. Select the File Types tab from the screen choices.
  4. Scroll to the File type extension or tap new if the extension isn't listed.
  5. To change the default application to be launched click the change button.
  6. Select the new application or browse to find it.
  7. Click ok to complete the selection.

For Windows Vista and Windows 7 there is a program to change the file type available.

[edit] MacOS X Object interface

A Mac will normally launch the right program but if it doesn't you can correct it.

  1. Single-click on the object file with the extension you want to fix.
  2. Go to the Finder->Get Info menu which will open a window with info about the file you selected.
  3. In that window go to “Open With” then use the pull down menu.
  4. If “The” is listed, then choose it and hit the “Change ALL” button.
  5. If it is not listed then choose: “Other …”
  6. It will open up a gui to allow you to select the app you want to open it with.
  7. The use the windows to navigate to “HD” (or whatever you call you main hard drive)
  8. browse to the location the application is loaded and then select the “correct”
  9. Then hit the Change All Button.

[edit] File system use

Some, but not all, file systems treat the file extension is a special way. For example files systems used on DOS systems such as FAT devote part of the file name specifically for an extension. In this case the dot is not stored in the file but displayed by programs that read the disk in order to separate the basename from the extension. File systems that have this kind of special treatment normally limit the size of an extension. In DOS it is limited to a maximum of 3 letters. If you try and use more characters it will truncate the extension to 3 letters.

Other file systems have no notion of an extension and treat the filename as a full name with or without a dot in the name. However, even on those systems utilities and applications may have conventions for extension use. For example, a C language compiler expects the source file to have a .c file extension. These conventions may help an editing program format the display of the data.

[edit] Program use

Application programs may use file extensions to filter their view of the file system to limit the choices of file names that they will show the user. If they support more than one file extension they may treat the various extensions differently. For example a text editor may use the file name extension to attempt to display the data in a special way using indentation or color.

[edit] Seeing File extensions in Windows

One of the poorer features in Windows is that, by default, it does not show file extensions for common files. This removes some useful information for the user. Luckily this feature can be turned off. The instructions below are for Windows XP but other OS's are similar.

  1. In Windows display any folder view such as "My Documents"
  2. On the Tools Menu select Folder options to display a form.
  3. Select the view tab on the form.
  4. Uncheck the entry "Hide extensions for known file types"
  5. the box "Apply to All Folders" and answer YES.
  6. click OK to leave the form.

Doing this can help avoid some Trojan viruses that attempt to fool you into clicking on them when you don't know they have a .exe extension which can allow them to infect your machine.

[edit] Multiple File extensions

While not supported directly by file systems it is usually possible to have multiple extensions on the same file. For example a file might be called In this case the zip means it is a compressed version of a .fb2 file. The order is important. The first thing an application must do is unzip the contents (last extension) and then interpret the .fb2 as an ebook format.

Again a virus might try and fool you if the final extension is hidden.

[edit] eBook Readers use

Even though most eBook readers use a Linux operating system and Linux is not normally dependent on file extensions the applications on the reader usually depends on the extensions to identify the file type. Ebook readers will even hide files and not display them at all if the file extension is not one it recognizes.

Most eBook Readers today actually have more than one eBook reading program available as well as music players and image viewers other features. The extension will usually be used to determine which reading program will be used for a particular format. Sometimes more than one program can read them same format but the reader will default to always using just one of those formats. For example Adobe Digital Editions mobile version is usually the default for PDF and ePUB files but the reader may also have FBReader or Cool Reader available for reading other file types. If you wanted Cool Reader to read your ePUB file you might try using Multiple file extensions to fool the OS to starting Cool Reader. For example if Cool Reader were the default application for .fb2 files you might change the name of your eBook to filename.epub.fb2. This way the eBook Reader would see the .fb2 and start Cool Reader and Cool Reader would figure out that the file is really .epub and react accordingly. Note that renaming the file to filename.fb2 would have also worked but then you might forget that it is really an epub file.

Personal tools

MobileRead Networks