Saturday, April 2, 2011

What is a File?

This may seem like a “duh” question, but do you really know what is a computer file?  A file is a block or resource for storing or retrieving information.  Back in the early days of computers a file was actually a real physical file known as a punch card.  Now days most files are stored magnetically on disk drives.  Files may also be stored on optical media and flash drives.  There are three main components of a file, the name, the extension (or type), and the size.
list of files without extensions
There are two parts to a file name; the name and the extension.  In the screenshot above I have a couple of different file types and even two files that have same the name (didn’t think you could do that?).  With current Windows operating systems and their file systems you can give a file virtually any name you want up to 255 characters, with the exception of special characters (\ / : * ? " < > |).  Back in the days of DOS, file names were limited to 8 characters (imagine trying to name all those images you have!); and only 3 characters for the extension.
The size of a file is measured in bytes, a byte is eight bits (or eight 0’s and 1’s).  For larger files kilo (KB - thousand), mega (MB - million), and giga (GB - billion) prefixes are used.  In the screen shot above, all the files are measured in kilobytes, with the biggest file only be 11,000 bytes (or 11 kilobytes).  With the exception of the ZIP file, the files in the screenshot are mostly simple text, which is the reason for the relatively small sizes.  Large files such as pictures and videos are often measure in megabytes and gigabytes.
Now, as for the two files that appear to be named the same. While the files are named the same, they have different extensions (screen shot below); one file is a .css (cascading style sheet) and the other .txt (text file).  So, you can name files the same, as long as the extensions are different.  In the screen shot below I have Windows set to show the extensions of files.
list of files with extensions

1 comment:

  1. Just wanted to stop in and tell you thanks for the information you share here on this blog. Sometimes I need to be reminded of how things work so that I can understand websites better. Please keep the posts coming, I am reading them.