Re: FAT text conversion

=?ISO-8859-1?Q?Johan_Myr=E9en?= (jem@vistacom.fi)
Fri, 28 Nov 1997 11:09:26 +0200 (EET)


On Fri, 28 Nov 1997, Paul Wilkins wrote:

> I know most of the kernel team don't really do DOS, but plenty of Linux
> users are often faced with the problem of opening text files on fat
> partitions, and hit the CR LF thing. I hit it all the time for text
> files, and when copying html from one partition to another.

> I've changed my own inode.c and misc.c slightly just to make the
> conversion a little easier.

> First, I've made conversion the default.

I think this is a very bad decision. As you say yourself, a
conversion is a hazardous excercise. There can never be a catch
all rule, and munging a binary file because it is taken as a text
file is much more harmful than not stripping the carriage returns
on a text file.

Your change does not follow the principle of least surprise.
I strongly feel that the default should be no conversion,
anything else is corrupting data behind the back of the
unsuspicious user.

Note that there are even situations where a conversion is not the
correct thing to do even when dealing with _text_ files on a DOS
file system: the client might be a DOS/Windows machine mounting a
share from a Samba server. (This example is not far fetched, I
actually had a Linux file server running with FAT disks for a
while, when converting an NT server to a Linux server.)

> The other thing is that with the conv=auto
> option, it makes conversion the default, barring known binary files. To
> my mind, this should work the other way, seeing as conversion is a
> hazardous exercise. I'd like to see the "auto conversion" defaulting to
> _not_ converting, and performing the conversion for files with known text
> extensions (.txt, .htm, .c, .h, ,jav ...).

You failed to mention for which Linux version your patch is, but
I assume it is for 2.0.x and not the development version, since
otherwise you would have noticed that the "auto" behaviour
already changed to this in 2.1.44.

> I think it would be worthwhile to make this the default behaviour for a
> fat mount, so that newbies would initially not have to bother with
> conversions with their text files.

What about the educated user, who knows of the problem with
different line breaks in DOS and Unix files, and relies on the
Unix philosophy that a file is a stream of bytes, with no
structure? Does he deserve to get his files silently corrupted?

Johan Myreen
jem@iki.fi