Hi,

CC afresh1@, with whom I've discussed this a little already.

If I make a FAT32 filesystem on a thumb drive on OpenBSD (using the default
parameters) and mount it (with the default options) and proceed to make some
strategically named files:

```
# touch a B aaaaa BBBBB longlonglong OPENBSD_OPENBSD
# ls
B  BBBBB  OPENBSD_OPENBSD  a  aaaaa  longlonglong
```

And now mount that filesystem (with default options) on a Linux box, we see
that some of the files appear with different case from how they were created
above:

```
# ls
a  aaaaa  b  bbbbb  longlonglong  OPENBSD_OPENBSD
```

After reading about the mess they made with FAT filesystems, what I think
happened was: OpenBSD made "long filename" entries for names that either didn't
fit in the 8.3 scheme, or which were not all upper-case (the assumption, I
think, being that files with no long filename will be displayed all upper-case
anyway, at least on OpenBSD).

The problem is that entries with no long filename seem to be open to
interpretation on different systems:

 - OpenBSD shows them upper-case
 - Linux (by default) shows them lower case.

If on Linux you mount with `-o shortname=win95`, then you get the same
interpretation as OpenBSD.

But is there (or should there be) a way to make OpenBSD display the filenames
as Linux would?

If everything above is correct, I think that would mean either creating all
files (even if they fit in 8.3) with a long filename, or changing OpenBSD's
interpretation of short-only filenames to be lower case. I see no
mount_msdos(8) options that may help.

Note that `-l` is the default:

>   -l    Force listing and generation of Windows 95/98 long filenames and
>         separate creation/modification/access dates.

I'm not sure if this is completely accurate. If we were really forcing
generation of long filenames, then the files `B` and `BBBBB` should have had
long filename entries, but they didn't appear to.

Should the sentence be suffixed "if the filename doesn't fit in the 8.3
scheme"? Or perhaps the behaviour `-l` should be changed to *really always*
create long filenames regardless of the length? I don't know.

Why do I ask? I need to copy lots of files, preserving case, to an SD card for
use in an embedded Linux machine on which I don't have control over the
filesystem type or mount options.

[One hack that I think would work for me, would be to rename all of my files
lower-case before copying to the FAT filesystem. This would force OpenBSD to
create long filenames, but that may not be suitable for every user's
circumstance]

Cheers

-- 
Best Regards
Edd Barrett

https://www.theunixzoo.co.uk

Reply via email to