Go to Home page Go to Railfan 
Guide Go to Tour Guide Train Gifs by Chris Denbow Go to Stanly 
County Railroad Overview e-Mail Tony Hill Visit the Frograil Railfan Store


FROGRAIL TRAIN GIFS

Train Gifs and File Names

Bad, Bad, Bad File Names
Good File Name Construction
ID Tags Within File Names
Have a Plan
A Few Hints
 


Just Plain Bad File Names and Why

One of the biggest shortcomings I see among new technology workers dealing with file management, the Internet, and scripting, is the lack of a systematic, intelligent, correct approach to file names.  Consider the following list of train gifs in a folder:

blktrl40rco.gif
440013.gif
C&O BAY WINDOW.GIF
 

There are significant, even serious, shortcomings with all of these names.  Here are the basic requirements of file naming:

  • The name must be meaningful and intelligible to you 6 months after you've created it.

  • The name must be meaningful to anyone who is allowed to use it.

  • The name must conform to protocol and program rules.

The artist who created the first gif, blktrl40rco.gif, perhaps drew a black trailer which was 40' long, facing to the right, and it was a Chesapeake and Ohio trailer.  On the other hand, maybe it's a blue, K-Line terminal shifter model 40, with a reciprocating cooling system.  Now that I've told you where that odd-looking name came from, do you think you could tell me what the subject of the gif is on a pop quiz, say, a month from now?  Probably not, as it is so chopped up as to be non-intuitive.

The next illustration, 440013.gif, is a very common one.  The artist has drawn car number 440013, or maybe it's drawing #440013 in some sort of arcane sequence of drawings.  So what is car number 440013, or what is the sequence?  Without some detailed translation material at hand, we'd never be able to figure out what the file's subject is.  Even if the creator of the image has such a translator at hand, most of us out in Internet land won't.

The final illustration, C&O BAY WINDOW.GIF, is actually much worse than the other two, because it has a fatal flaw.  Fatal because it won't work on the Internet, and it won't work in a scripted scene.  As an oversimplified rule, you are not allowed to use special characters in a file name.  "No, no", you cry, "I use them all the time in Word, Excel, etc."  True, but the rules for those programs are not the same rules as we encounter outside of the warm, fuzzy confines of Microsoft Office and other such application programs.

When you type an Internet address, such as http://www.frograil.com, the http:// specifies that the browser is going to send, receive, and render files using Hypertext Transfer Protocol, or HTTP.  When you write a javaScript scene with trains moving all about, the browser reads and executes scripts based on the rules peculiar to javaScript.  Both HTTP and javaScript, like all other protocols and programming languages operate within the framework of "a set of rules".  In both cases, special characters are not allowed.  While the "&" is obviously a special character, the spaces between the O and B, and the Y and W are not so obvious.  A blank space (more correctly a non-breaking space) is actually a special character just like the &. 

When your browser encounters an address such as http://www.frograil.com/gifs/pennsy k-4.gif, it may do any number of things to try to retrieve the file you want, but it will probably just go out looking for http://www.frograil.com/gifs/pennsy , and you'll get a 404 "File not Found" message.  The blank space will usually be interpreted as the end of the address.  The same is true in a javaScripted train gif scene.  If you ask your browser to render createConsist("pennsy K-4.gif"), the script will freeze up, or you'll be asked to declare a variable or function or some other confusing thing, all because you've got a space in your file name.

Different programs and protocols allow/disallow different special characters, so how do you keep the different rules apart?  The easy way is to never, ever use special characters other than the hyphen (-) and underscore (_).  I personally never use the underscore, because it costs extra effort to use the shift key with it.  Remember:  Anything not a number or letter is, by definition, a special character.

Back to the Top


Good File Name Construction

So, we've exhausted the bad, bad, bad side of file naming, and now need to look at good file names.  To make them meaningful and intelligible months after their creation, and to make sure they adhere to the rules of the Internet and the programs thereon, we need to take advantage of a few techniques and common sense.  Ever since the Windows operating systems evolved beyond the limit of having only 8 digits in a file name, we've had the luxury of using common sense names.

Good programmers start a file or function name with a lower case letter, and thereafter begin each new word in the name with a capital, such as:  erieBulkheadFlatGreen.gif .  It's pretty obvious that this gif is of an Erie bulkhead flat, and that it's green.  You could write that as eriebulkheadflatgreen.gif, but it's much less readable.  There are many keystrokes in the name, but since it's logical and understandable, it's easier to type than a much shorter one that is cryptic and difficult or impossible to translate.  As a general rule, avoid all abbreviations, unless they are really common and obvious.  MT is universally used for "empty", but what does "wsdob" mean?  How about "wood, single door, outside braced", but that's a guess only, as I'm not the artist.  As you use more and more abbreviations, you rapidly increase the odds that your file names will become unintelligible.

If you'll take a few moments to create meaningful, intelligible file names, you'll be rewarded over and over again, and you'll not have to puzzle over why your material will not display or transfer properly on the Internet.

There's another reason why logical and understandable file names are important.  Say you've got a train in a train gif scene, and the link to one of your cars is busted.  Instead of such and such a car, all you're getting is a moving white box with a small red "x" in it.  Consider the code for one of my Virginia Scene trains:

createConsist("csxDragSouth2","../../graphics/gifs/class1/csx/CSXsd60ileft.gif,../../graphics/gifs/clas
s1/csx/CSXsd60right.gif,../../graphics/gifs/miscellaneous/miscEngines/HLGXc36-7eright.gif,../../graphics/gifs/miscellaneous/miscCars/50pschopp_tldx-wl.gif, ../../graphics/gifs/miscellaneous/miscCars/50obpd_nacx.gif, ../../graphics/gifs/miscellaneous/miscCars/cement_hwcx.gif, ../../graphics/gifs/fallenFlagsA-L/drgw/60rblobbox_drgw.gif, ../../graphics/gifs/miscellaneous/miscCars/ADMXtank2.gif, ../../graphics/gifs/fallenFlagsA-L/ic-icg/50wsdobbox_ic-org.gif, ../../graphics/gifs/fallenFlagsA-L/co/86hc2dbox_co.gif, ../../graphics/gifs/miscellaneous/miscCars/502pdbox_evg.gif, ../../graphics/gifs/fallenFlagsA-L/atsf/50sdbox_atsf-elcapt.gif, ../../graphics/gifs/miscellaneous/miscCars/ACFXtank.gif, ../../graphics/gifs/fallenFlagsA-L/bn/bncovhopper.gif, ../../graphics/gifs/miscellaneous/miscCars/CRYXreefer.gif, ../../graphics/gifs/class1/bnsf/bulkheadflat.gif,../../graphics/gifs/miscellaneous/misc Cars/50RBL_HAMMS.gif,../../graphics/gifs/miscellaneous/miscCars/ACFXcf5250.gif");

While the artists who contributed these gifs used varying degrees of good file naming, in reality, all could be improved with a little forethought.  In the real world, the lines of code are in a great jumbled up blob of a single paragraph, and finding the correct car can be difficult, time-consuming and frustrating.  Good file names reduce the time and effort needed to de-bug scripts and HTML tagging tremendously.

Back to the Top


ID Tags within File Names

Since you're creating works of art, even if small ones, you might want to consider putting some personal identifying marker within your file names.  Suppose your name is Sam W. Wilson, and you've created a series of Santa Fe gifs, such as atsfReeferBigBillboard.gif and atsfReeferOldBillboard.gif, etc.  As a matter of routine, you could insert SWW or Sww somewhere within all of your file names, such as:  atsfReeferBigSwwBillboard.gif and atsfReeferOldSwwBillboard.gif .  Believe me, the majority of the thieves and rude brats out there stealing stuff don't know file names from shinola, and it would be immediately obvious if someone were using your material.  After all, the Sww is really meaningless, except to identify the file as originating from Sam W. Wilson, and no one will know that except you.

Back to the Top


Have a Plan

Before you draw a group of gifs, have a plan as to how you're going to name them.  Suppose you're drawing a series of 1930's hopper cars of the N&W.  They're all 36' long, and have either 2 or 3 bays, and are either black or box car red.  They are also loaded or empty (MT).  Also, assume you're Sam W. Wilson.  Here's a logical approach:

    nw36Hopper2BaySwwBlackLoad.gif
    nw36Hopper2BaySwwBcrLoad.gif
    nw36Hopper2BaySwwBlackMT.gif
    nw36Hopper2BaySwwBcrMT.gif
    nw36Hopper3BaySwwBlackLoad.gif
    nw36Hopper3BaySwwBcrLoad.gif
    nw36Hopper3BaySwwBlackMT.gif
    nw36Hopper3BaySwwBcrMT.gif
 
Write these out before you even begin to draw, and the mechanical file naming stuff is easy -- allowing you to concentrate on the hard part -- drawing the artwork itself. 

Back to the Top

A Few Hints:

1.  If you're going to use an L to denote "left", such as bnsfGP38-2L, use an uppercase L, because many font faces display a lower case l and a number 1 either identically or very similarly.

2.  Comments made relative to correct file names generally apply to folder names.  That is, blank spaces, special characters, etc, are not allowed in entire path to a particular file, not just in the file name itself.  For example, the following URL would be unacceptable:  http://www.frograil.com/photos/butterfly skin/medicine.htm .