Tips on Computer Technology By: Bill Michling
Welcome back, I hope you had a great week. Last week we talked about “file forks” and a neat screen saver called “Blackwatch”. If you missed last weeks column, you can find it at ( http://www.mespn.com/techArticles ) as well as all other past articles.
This week will continue to talk about file names and how they are handled. We also answer the question “How many folders can I put inside of each other?” Also “What information can you find in the directory?”.
OK lets get started.
** Directory Information (Pathnames)
How many of you know what a “pathname” is? Come on lets see those hands, I know some of you know! Alrighty then, a pathname is the complete list ,starting from your hard drive, of names that point to your file. The way it starts is from the drive name, then each folder name, and finally the file name. Each name is separated by a “:” colon. here is an example; Bill:applications:appleworks 6, this means on the hard drive called “bill”, is a folder called “applications”, and in that folder is a file called “Appleworks 6”.
Simple huh? Ah, but not all is good with pathnames. In fact Apple has recommended for some time that developers NOT use the path name. Why? It has too many restrictions, such as a maximum of 255 characters in the complete pathname! What this means is you are limited in how many folders could be inside each other depending on the name length… OK, so if pathnames are not good, how can we find our files?
In the MacOS, unlike other disk operating systems, Apple has seen fit to put in other ways to find a file. This will be the next topic.
** Directory Information (Directory keys)
Since it is recommended by Apple to NOT use pathnames, what do we use? Apple has set up in the Mac disk operating system “Directory Keys”. All files have a listing in the directory. There are listed in order by the folder then the item name. Remember the item can be a file or folder. This can be compared to a phone book. If you look in the yellow pages you find an alphabetical category then a listing. The combination of the folder name and the item name are called a “item key”. Because all the items are listed by the order of the key, the MacOS can find an item very fast. The key has to be unique, so the items name is actually a unique number which is called a “catalog node ID”. By generating a number the disk operation system can insure the ID is unique.
Now lets look at what a catalog node ID is, what it is used for and why it is so great!
** Directory Information (catalog node ID)
As we mentioned above the catalog node ID identifies each folder and file. The major advantage is a file or folder can be found even if it is moved or if the file or folder is renamed!
This is why on the Mac you can put any item anywhere and it still works. Caution, don’t try this on a Windows machine, especially if the item is an application. It may not work anymore if you move it!
The lowest ID assigned to files and folders is 16 and the highest ID is 4,294,967,295. IDs are assigned starting from the lowest ID. An entry in the directory of each disk keeps track of the next ID to assign. If an item is deleted, its ID is never reassigned. Theoretically you could use up all possible IDs while creating and deleting files on a disk. It has been said that if you create a file each second, it will take about 136 years to run out of IDs!! I think we can safely say that we do not have to be concerned about running out of catalog node IDs….
I hope this has helped you to understand why the MacOS is a technologically advanced operating system as compared to others. When you add this to the “file fork” capability, you can see why the MacOS is so flexible….
If you would like to learn more about the MacOS, check out (http://www.apple.com/developer) or (http://www.info.apple.com/support/pov.taf?type=started&product=macos9) That’s it for this week, hope to see you next week with more exciting technology information!
==================
Bill Michling is a computer professional and welcomes any comments or questions you may have. Just send email to: bill@mespn.com or michling@usa.net.
