Subject: bin/14596: Long filenames on FAT Partitions
To: None <gnats-bugs@gnats.netbsd.org>
From: None <r.phillips@mailbox.uq.edu.au>
List: netbsd-bugs
Date: 11/16/2001 13:05:48
>Number:         14596
>Category:       bin
>Synopsis:       Long file names on FAT partions not preserved in Windows.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 15 19:12:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ray Phillips
>Release:        NetBSD 1.5.2
>Organization:
JMKRC, University of Queensland
>Environment:
	
System: NetBSD tmstage1.jkmrc.uq.edu.au 1.5.2 NetBSD 1.5.2 (GENERIC) #3: Sat Aug 18 23:37:05 CEST 2001 he@hamster.urc.uninett.no:/usr/src/sys/arch/i386/compile/GENERIC i386


>Description:
Whan a FAT16 partition is mounted an a PC running NetBSD/i386 1.5.2 and some files are ftp'd to it (from a Macintosh in this case) the long file names are created properly, but they're not preserved when viewed on a Windows 95 machine--they become the same as their abbreviated 8.3 form.

The problem occurs when a file name contains this pattern

    'some letters' '.' 'a space' 'some letters' '.' 'some letters'

although this isn't always the case.  Note that the file name 'ord. fl.1.mus' was not altered in the listings supplied later in this PR.

>How-To-Repeat:
Mount a drive containing a FAT16 partition on a PC running NetBSD/i386 1.5.2 and ftp some files to it from a Macintosh using Fetch 3.0.3.  I assume it doesn't matter where the files are ftp'd from.  :)  Come to think of it, I didn't try just creating a file on the FAT partition in NetBSD and seeing if its name remained the same in Windows 95--presumably that makes no difference either.  The files I was using when I discovered this anomaly are shown in the following listings.

Mac Listing
===========

Alchemy of Love          <- Folder name
Alc. cb.mus
Alc. fl1.mus
Alc. harp.mus
Alc. timps.mus
Alc.bssn1.mus
Alc.cl.1.mus
Alc.Cl2.mus

Ordinary Man             <- Folder name
ord. fl.1.mus
ord. hp.mus
ord.bssn.1.mus
ord.bssn.2.mus
ord.cb.mus

foo                      <- Folder name
foo. bar.1
foo.bar.1


NetBSD Listing
==============

ray# pwd
/mnt/kf/expt
ray# ls -l
total 24
drwxr-xr-x  1 root  wheel  8192 Nov 13 18:28 Alchemy of Love
drwxr-xr-x  1 root  wheel  8192 Nov 13 18:31 Ordinary Man
drwxr-xr-x  1 root  wheel  8192 Nov 13 18:35 foo
ray# cd 'Alchemy of Love'
ray# ls -l
total 2328
-rwxr-xr-x  1 root  wheel  332833 Nov 13 18:29 Alc. cb.mus
-rwxr-xr-x  1 root  wheel  331452 Nov 13 18:29 Alc. fl1.mus
-rwxr-xr-x  1 root  wheel  367174 Nov 13 18:29 Alc. harp.mus
-rwxr-xr-x  1 root  wheel  295349 Nov 13 18:29 Alc. timps.mus
-rwxr-xr-x  1 root  wheel  337871 Nov 13 18:29 Alc.Cl2.mus
-rwxr-xr-x  1 root  wheel  337174 Nov 13 18:29 Alc.bssn1.mus
-rwxr-xr-x  1 root  wheel  348775 Nov 13 18:29 Alc.cl.1.mus
ray# cd ../'Ordinary Man'
ray# ls -l
total 1168
-rwxr-xr-x  1 root  wheel  239694 Nov 13 18:32 ord. fl.1.mus
-rwxr-xr-x  1 root  wheel  215859 Nov 13 18:32 ord. hp.mus
-rwxr-xr-x  1 root  wheel  241066 Nov 13 18:32 ord.bssn.1.mus
-rwxr-xr-x  1 root  wheel  235304 Nov 13 18:32 ord.bssn.2.mus
-rwxr-xr-x  1 root  wheel  240864 Nov 13 18:32 ord.cb.mus
ray# cd ../foo
ray# ls -l
total 16
-rwxr-xr-x  1 root  wheel  3 Nov 13 18:35 foo. bar.1
-rwxr-xr-x  1 root  wheel  3 Nov 13 18:35 foo.bar.1
ray#


PC Listing
==========

D:\> cd
D:\kf\expt

D:\> dir/s

 Volume in drive D has no label
 Volume Serial Number is 1E4C-1BFE

Directory of D:\kf\expt

.              <DIR>        11-13-01  8:24a .
..             <DIR>        11-13-01  8:24a ..
ALCHEM~1       <DIR>        11-13-01  8:28a Alchemy of Love
FOO            <DIR>        11-13-01  8:35a foo
ORDINA~1       <DIR>        11-13-01  8:31a Ordinary Man
         0 file(s)              0 bytes

Directory of D:\kf\expt\Alchemy of Love

.              <DIR>        11-13-01  8:28a .
..             <DIR>        11-13-01  8:28a ..
ALC CB~1 MUS       332,833  11-13-01  8:29a ALC CB~1.MUS
ALC FL~1 MUS       331,452  11-13-01  8:29a ALC FL~1.MUS
ALCBSS~1 MUS       337,174  11-13-01  8:29a Alc.bssn1.mus
ALCCL1~1 MUS       348,775  11-13-01  8:29a Alc.cl.1.mus
ALCCL2~1 MUS       337,871  11-13-01  8:29a Alc.Cl2.mus
ALCHAR~1 MUS       367,174  11-13-01  8:29a Alc. harp.mus
ALCTIM~1 MUS       295,349  11-13-01  8:29a Alc. timps.mus
         7 file(s)      2,350,628 bytes

Directory of D:\kf\expt\foo

.              <DIR>        11-13-01  8:35a .
..             <DIR>        11-13-01  8:35a ..
FOO BA~1 1               3  11-13-01  8:35a FOO BA~1.1
FOOBAR~1 1               3  11-13-01  8:35a foo.bar.1
         2 file(s)              6 bytes

Directory of D:\kf\expt\Ordinary Man

.              <DIR>        11-13-01  8:31a .
..             <DIR>        11-13-01  8:31a ..
ORD HP~1 MUS       215,859  11-13-01  8:32a ORD HP~1.MUS
ORDBSS~1 MUS       241,066  11-13-01  8:32a ord.bssn.1.mus
ORDBSS~2 MUS       235,304  11-13-01  8:32a ord.bssn.2.mus
ORDCB~1  MUS       240,864  11-13-01  8:32a ord.cb.mus
ORDFL1~1 MUS       239,694  11-13-01  8:32a ord. fl.1.mus
         5 file(s)      1,172,787 bytes

Total files listed:
        14 file(s)      3,523,421 bytes
        11 dir(s)     130,187,264 bytes free
>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted: