file name case issue on fat32 (Was: Re: Sharing data files on a dual-boot machine ...)

Micah micahjon at ywave.com
Tue Sep 27 07:15:48 PDT 2005



martinko wrote:
> Alex Zbyslaw wrote:
> 
>> martinko wrote:
>>
>>> Dmitry Mityugov wrote:
>>>
>>>> On 9/27/05, martinko <martinkov at pobox.sk> wrote:
>>>> ...
>>>>
>>>>> hello,
>>>>>
>>>>> when i mount a fat32 partition some files have different case (see
>>>>> below) then in windows. how come ??
>>>>>
>>>>> e.g.:
>>>>>
>>>>> $ ll
>>>>> -rwxr-x---  1 root  wheel    734 Mar  1  2005 a.txt
>>>>> -rwxr-x---  1 root  wheel    649 Mar 16  2003 A.txt~
>>>>> -rwxr-x---  1 root  wheel   1110 Mar 27  2003 b.txt
>>>>> -rwxr-x---  1 root  wheel   2980 Jun  6 23:46 c.txt
>>>>> -rwxr-x---  1 root  wheel   2475 Mar  1  2005 C.txt~
>>>>> -rwxr-x---  1 root  wheel   2563 Jun 10 12:49 d.txt
>>>>> -rwxr-x---  1 root  wheel   2561 Jun 10 12:42 D.txt~
>>>>> -rwxr-x---  1 root  wheel   1015 Jun  7 00:25 e.txt
>>>>> -rwxr-x---  1 root  wheel    681 Mar 16  2003 E.txt~
>>>>> -rwxr-x---  1 root  wheel    602 Mar 16  2003 f.txt
>>>>> -rwxr-x---  1 root  wheel    421 Mar 16  2003 g.txt
>>>>>
>>>>> in windows all the files above have first letter in uppercase, that is
>>>>> "A.txt" for instance.
>>>>
>>>>
>>>>
>>>
>>> sorry if i didn't make myself clear. -- ALL the file names above 
>>> should have their first letter, and only the first letter, in upper 
>>> case. that's how they were named in windows. but as you can see 
>>> above, freebsd does not show them properly as some of them are shown 
>>> in lowercase (e.g. "a.txt" instead of "A.txt").
>>>
>>> why??
>>
>>
>>
>> Because FAT32 is a case-insensitive file system.  Don't confuse how 
>> Windows explorer shows you the file name with how the file name is 
>> actually stored on the file system.
>>
>> --Alex
>>
> 
> ok. unfortunately i forgot most of my knowledge from the old days of 
> ms-dos but what i can say even without it is this -- it's not about 
> windows explorer only. i can see the correct file names in all 
> applications (under windows of course), i believe. and if windows knows 
> whether there should be an "A" or "a" then why freebsd cannot?
> 
> martin
> 
> ps: and, btw, how freebsd knows there's a capital A in "A.txt~" ? 
> because it's stored on the filesystem in that way, i guess. being 
> case-insensitive doesn't (necessarily)  mean a FS doesn't keep a case, 
> imho.

The reason is as follows: a.txt is an 8.3 filename and is stored on 
fat32 in the old dos format.  a.txt~ is NOT an 8.3 filename and is 
stored on fat32 in the extended long filename format.  Case information 
is not stored in 8.3's file names.  They're always the same case, but I 
can't remember now if they're stored as upper or lower case.  Extended 
long filenames do store case information, even though windows ignores 
the case (as was pointed out earlier).  FreeBSD is displaying 8.3 names 
as lowercase probably to mimic the tendency of unix filenames to be 
lowercase.  Windows displays 8.3 names as upper case probably to mimic dos.

Later,
Micah


More information about the freebsd-questions mailing list