file names : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

file names
Java lets you use any filename the current OS (Operating System) supports. However if your program uses any filenames not supplied by the end user, you want ones that will work on every conceivable platform. Consider avoiding names like this:

Case Sensitivity

In some platforms the precise case of each letter matters and on others it does not. For example Vista does not care, but Linux does. On a case-sensitive system, strawberry.txt and Strawberry.txt are two separate files. This can lead to confusion when files are manipulated both in the program and externally with a GUI (Graphic User Interface) explorer or command line shell.

My rule of thumb is to keep all filenames lower case (easier to type), easier to remember, with the exception of the *.java and *.class files which must follow Java conventions.

Sort Order

When you are naming a group of similar files, think about how they will sort alphabetically. Files named with the pattern receipts-YYYY-MM-DD.log e.g. receipts-2008-12-31.log will sort more sensibly than receipts-MM-DD-YYYY.log. Even safer would be to use the pattern receiptYYYYMMDD.log.

This page is posted
on the web at:

http://mindprod.com/jgloss/filenames.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\filenames.html
logo
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
Blog
IP:[65.110.21.43]
Your face IP:[54.234.2.94]
You are visitor number