Jump to content

Lowercase filenames on XP -> uppercase on 9x?


osRe

Recommended Posts

Does anyone know why some filenames created as/renamed to all lowercase on XP appear as all uppercase in 9x? Is there a way to fix it on the XP side?

Link to comment
Share on other sites


It's not that all uppercase names aren't shown in 9x, they are. It's that some all lowercase in XP appear as uppercase in 9x.

I found the cause. 2K/XP use two bits in a reserved byte in the directory entry (the FAT32 specs call the byte DIR_NTRes) to indicate whether the name or extension part of a 8.3 filename are uppercase or lowercase. Thus, names that can be represented as 8.3 like that don't have an associated LFN, and Win9x only has the SFN to go by.

It's possible that NT5.2 and higher no longer use these bits and always create proper LFN entries.

So, with the cause known... does anyone know of a simple way to read a directory's binary data in Win9x, other than manually walking the cluster chain?

Refs:

microsoft.public.win98.gen_discussion \ "UPPERCASE always from other units" \ post by Franc Zabkar about byte value 0x18

fdos.org \ FAT+ proposal initial draft

Wikipedia \ 8.3 filename

Edited by shae
Link to comment
Share on other sites

It's not that all uppercase names aren't shown in 9x, they are. It's that some all lowercase in XP appear as uppercase in 9x.

I found the cause. 2K/XP use two bits in a reserved byte in the directory entry (the FAT32 specs call the byte DIR_NTRes) to indicate whether the name or extension part of a 8.3 filename are uppercase or lowercase. Thus, names that can be represented as 8.3 like that don't have an associated LFN, and Win9x only has the SFN to go by.

It's possible that NT5.2 and higher no longer use these bits and always create proper LFN entries.

So, with the cause known... does anyone know of a simple way to read a directory's binary data in Win9x, other than manually walking the cluster chain?

Refs:

microsoft.public.win98.gen_discussion \ "UPPERCASE always from other units" \ post by Franc Zabkar about byte value 0x18

fdos.org \ FAT+ proposal initial draft

Wikipedia \ 8.3 filename

You're talking about the FAT32 file system here, viewed under both Win9x and Win2K/XP/+, am I correct?

One answer to the last question is a disk file system browser, like DirectorySnoop, a trial/buy non-free utility (but infinitely useful for file recovery and exploration). Worth every penny. You get both a FAT32 module and an NTFS module in the package, they are Windows GUI apps and not command line. With it you can see every detail from cluster chains, to any sector contents, deleted files and folders and lots of technical stuff in the help. It is not a disk editor like Norton was (but almost nothing is :-)) although it replaces much of it.

Directory entries and LFN on FAT32 gets complicated. Here is a very good refresher (at least a decade old!) ...

Long File Names

See especially the info on LFN Bloat. On FAT32 every file had a 8.3 directory entry which typically appeared all uppercase in Explorer, but I believe there was a setting to make them appear to be mixed case which is more aesthetically pleasing but did not actually alter the directory entries (can someone verify?).

Now this *is* important: once you modify any standard 8.3 filename like capitalizing one letter (or use a 4 character extension, etc), then you just created a bona fide LFN and an extra, additional LFN directory entry was generated. Do this to a folder full of 1000 files and a thousand new additional LFN directory entries were generated. This could lead to bloat, and add in some fragmentation and things might slow down. I believe this is why the default was to stick with 8.3 uppercase and LFN generation was left to the user a la carte so to speak.

I am not sure I understand fully your problem, but I am led to believe that you are using FAT32 disks in WinXP and setting them to proper LFN while in WinXP. I suspect that placing this disk back in a Win9x system will have different performance issues (because of the much better memory management in WinXP over Win9x). Win2K/XP+ will have no problem with huge FATs whereas Win9x gets flaky sometimes (e.g., coupled with a large registry, low resources, ...). But it seems everyone has different results. YMMV.

To avoid digging into actual directory entries (walking the cluster chain), there is a nice free utility called ChangeCase (also a windows GUI app) that I always use when I wanted to purposely set entire directories or drives to Upper/Lower/Mixed/Title case (and of course create tons of LFN directory entries in the process). It allows you to set the case however you prefer. For example, I always found it useful to set all folders a certain way (attributes too) and then later I could quickly eyeball a change made by some other program behind my back. This utility works fine in both Win9x and WinXP. Is that what you are looking for?

Link to comment
Share on other sites

Thanks Charlotte. The problem is that NT5 stores certain 8.3 names, that normally should be stored as LFNs, using a FAT directory extension that's not understood by 9x, which can only interpret the short name. It applies to FAT12, 16, or 32. Yes, there's a way to have all uppercase appear lowercase (or maybe capitalized) in 9x Explorer, that's what Mijzelf referred to, but it's unrelated. BTW, I never noticed problems with performance, at least not anything that stands out of the normal.

I'm not looking for a disk/filename editing utility, but for an easy way to get the raw directory data programatically, or better, raw directory entry for a given filename, so that I could create a utility to fix automatically the names that need fixing.

Edited by shae
Link to comment
Share on other sites

See especially the info on LFN Bloat. On FAT32 every file had a 8.3 directory entry which typically appeared all uppercase in Explorer, but I believe there was a setting to make them appear to be mixed case which is more aesthetically pleasing but did not actually alter the directory entries (can someone verify?).

Yes. It is a setting in the Folder Options. It is called "Allow all uppercase names". The default is mixed case.

Using mixed case can cause an undesired side effect.

I use all uppercase names for many files on my Website. When uploading updates to files on the website from a new Computer, the Upload Dialog Box changed the names, seen by the Uploading Software, to mixed case. Many Web Hosts use Case Sensitive Operating Systems so my uploads ended up as separate files leaving the unupdated files for my website users.

Link to comment
Share on other sites

rloew, do you know where the implementation of FAT sits between the user API in KERNEL32 (e.g., FindFirstFile()) and the low level disk access? Is it in IFSMGR or somewhere else? I want to get in the middle and fetch the DIR_NTRes byte (offset 0x0C) on each call to FindFirst/Next.

Link to comment
Share on other sites

rloew, do you know where the implementation of FAT sits between the user API in KERNEL32 (e.g., FindFirstFile()) and the low level disk access? Is it in IFSMGR or somewhere else? I want to get in the middle and fetch the DIR_NTRes byte (offset 0x0C) on each call to FindFirst/Next.

VFAT.VXD

Link to comment
Share on other sites

Can you recommend a way to extract VFAT from VMM32.VXD? If a standalone VXD is placed under SYSTEM\VMM32\, will it override the one inside VMM32.VXD?

Link to comment
Share on other sites

Can you recommend a way to extract VFAT from VMM32.VXD? If a standalone VXD is placed under SYSTEM\VMM32\, will it override the one inside VMM32.VXD?

Three ways:

1. Extract the original version from the Windows installation CD.

2. Download and extract a Microsoft Hotfix.

3. Buy my 1TB Patch package which has a built in extractor, or TBPLUS Package with all mods included.

Yes. Any standalone VXD will override it's corresponding component within VMM32.VXD.

Link to comment
Share on other sites

Wow! This is getting heavy. :blink:

All I can say about files transfered from an XP/w2k box to a 98 box is that I only have to change the first letter of an 8.3 file name from upper case to lower case and the rest of the letters automatically become lower case as well. The exception is when the file name begins with a number instead of a letter, then I have to retype the entire file name in lower case. :)

Link to comment
Share on other sites

Thanks Charlotte. The problem is that NT5 stores certain 8.3 names, that normally should be stored as LFNs, using a FAT directory extension that's not understood by 9x, which can only interpret the short name. It applies to FAT12, 16, or 32. Yes, there's a way to have all uppercase appear lowercase (or maybe capitalized) in 9x Explorer, that's what Mijzelf referred to, but it's unrelated. BTW, I never noticed problems with performance, at least not anything that stands out of the normal.

I'm not looking for a disk/filename editing utility, but for an easy way to get the raw directory data programatically, or better, raw directory entry for a given filename, so that I could create a utility to fix automatically the names that need fixing.

Some kind of analysis and report generator I would guess, but I cannot think of anything. You might want to scour around the MDGx site for starters.

When I used to juggle hard drives between Win9x and WinXP systems a lot, I too would notice odd things, like illegal characters in filenames, shortcuts and such. I just chalked it up to the natural unicode-ness of NT5 and its probable lack of error checking which would be needed to ensure backwards compatibility to FATxx and Win9x. I figured Microsoft just stopped caring, and after a while, so did I. One could spend a lifetime correcting these mistakes.

Anyway, what I would do when this would happen was to run a blue screen scandisk (never trusted the GUI version) with a highly edited SCANDISK.INI and switches to fix nothing except generate a report. I then took this LOG file and manually fixed everything that I felt I needed to correct.

From that same website I noted above, see Understanding ScanDisk, and FAT File System Troubleshooting for some general information. Microsoft article #199557 gives the command line switches. I always used /checkonly and /custom.

Those programs I mentioned previously ...

ZealSoftStudio ChangeCase ... available here ... (completely free)

Briggs Softworks DirectorySnoop ... available here ... (retail trial)

Another possibility is X-Ways WinHex seen here (retail trial) which has some analysis functions and forensic ability.

Yes. It is a setting in the Folder Options. It is called "Allow all uppercase names". The default is mixed case.

Using mixed case can cause an undesired side effect.

I use all uppercase names for many files on my Website. When uploading updates to files on the website from a new Computer, the Upload Dialog Box changed the names, seen by the Uploading Software, to mixed case. Many Web Hosts use Case Sensitive Operating Systems so my uploads ended up as separate files leaving the unupdated files for my website users.

Thanks. So I had my 'logic' reversed. That is important to know.

So the duhfault in Win9x was to display (false) mixed case until you checked the box to the Allow all uppercase names. This would force the GUI to display filenames as they are actually stored. Once this setting was enabled any uppercase filenames in Explorer would presumably be files that only had the standard 8.3 entry. Any mixed case filenames in Explorer would presumably be files that had *both* an 8.3 standard entry and the extra LFN entry(s).

EDIT: added link to FAT32 section of MDGx site.

Edited by CharlotteTheHarlot
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...