how short file names work.

Does anyone know how long file names are converted into short file names.  I need to know.  I was looking at a directory structures and it looks like it takes the first 6 characters but the final characters seem to be unsequences.  I have created a cd of mp3 that I have backed up here is what the songs are and their equivalent 8 letter file names.

ACDC-Y~6 MP3     2,944,493  03-09-98 12:09p AC DC - You Shook Me All Night Long.
ACEOF~18 MP3     4,260,418  10-01-99  4:46p Ace of Base - Cruel Summer.mp3
APOTH~32 MP3     2,941,464  10-01-99  4:46p Apotheosis - O Fortuna.mp3
BAREN~42 MP3     3,304,952  10-01-99  4:47p Barenaked Ladies - Its All Been Done
BAREN~54 MP3     2,701,130  10-01-99  4:47p Barenaked Ladies - One Week.mp3
BIFNA~64 MP3     4,161,326  07-30-98  3:05p Bif Naked - Spaceman.mp3
BILLI~78 MP3     4,350,272  10-01-99  4:47p Billie Myers - Kiss The Rain.mp3
BRYAN~92 MP3     4,383,402  10-01-99  4:47p Bryan Adams - Cuts Like A Knife.mp3
BRYA~108 MP3     6,306,537  10-01-99  4:48p Bryan Adams - Everything I Do I Do I
t For You.mp3
DANG~128 MP3     3,744,900  02-22-99 10:16p dangerous creatures.mp3
DANZ~142 MP3     3,273,584  10-01-99  4:48p Danzig - Mother.mp3
DRUN~152 MP3     5,040,250  10-01-99  4:48p Drunk Daddy - Purple Haze.mp3
FIFT~168 MP3     1,490,570  04-17-98 12:08a Fifth Element - Diva Dance.mp3

as you can see it does look a bit random.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patricia Siu-Lai HoCommented:

      For every long file name, an alias entry is generated automatically that complies with the 8.3 file name rules for backward compatibility.

      Automatically generated aliases are composed of the first six characters of the file name plus ~n (where n is a number) and the first three characters after the last period.

      So the file name ThisIsALong.File.Name is associated with the automatically generated alias THISIS~1.NAM. If the alias name already exists, the algorithm will generate a unique value for n.

      Thus, in better management of the file names, use different alphabets starting with the initial 5 characters of a long file name will help.

e.g.  Oct Status Report    ->        OCTSTA~1.TXT
      Nov Status Report    ->        NOVSTA~1.TXT
      Dec Status Report    ->        DECSTA~1.TXT

    BRYAN~92 MP3     Bryan Adams - Cuts Like A Knife.mp3
    BRYA~108 MP3     Bryan Adams - Everything I Do I Do I

    It is better to use long names as:-

     Cuts Like A Knife.mp3 - Bryan Adams    CLAKF~1.MP3    
     Everything I Do I Do I - Bryan Adams   EIDID~1.MP3

     But CLAKF~1.MP3, EIDID~1.MP3 may not be exactly as alias is automatically generated through you system by its algorithm.

Neither the user nor an application can control the name created by the automatic alias process.

For the file name to comply with the 8.3 file name rules, it must use only the valid characters for an alias and it must be all uppercase. Valid characters for 8.3 file names (and aliases) can be any combination of letters and numbers, a space (ASCII 20H), ASCII characters greater than 127, and the following special characters:

$ % ' - _ @  ~ ` ! ( ) ^ # &

The following additional characters are valid in long file names, but are not valid in alias names or 8.3 file names:

+ , ; = [ ]

The following rules also apply for Windows 98 file systems:

Maximum file name component length is 255 characters, including NULL.

Maximum path length is 260 characters, including NULL (compared to 80 characters for a short name).

The OEM character set used by the installable file system (IFS) is determined by the registry and the contents of the file Unicode.bin.
The long file name directory entries use the Unicode character set to store the names.
The file name and the alias are the same if the file name meets 8.3 file name rules (that is, if it contains only valid characters for an alias and it is all uppercase).

This means that a file name using only valid characters for an alias and following the 8.3 file name format is still not the same as the alias name if it contains lowercase characters.

However, in this case the alias is the uppercase version of the file name.
For example, if the long file name is Examples.txt, its alias is EXAMPLES.TXT. The case is preserved in the long file name.
(Note, though, that path-based APIs in the Windows 98 file system are not case-sensitive. So a search of the form "EXAMPLES.TXT" or "Examples.txt" will find the same files.)


To see the alias for a file, right-click the file in any shell program such as Windows Explorer, and then select Properties from the context menu. The value for MS-DOS Name in the General Properties dialog box shows the alias assigned to this file. Also, the dir command at the command prompt shows the long file name.

Hope this can be in assistance.      pslh

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isilverAuthor Commented:
It's acceptable.  With a issue like this it's probably the best answer available.  I had found a work around for my programming problem anyways.  thanxs.
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.
Thank you,
Moderator @ Experts Exchange
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.