Re: FAT text conversion

Paul Wilkins (paulw@monsterboard.com.au)
Sat, 29 Nov 1997 17:53:18 +1100 (EST)


On Fri, 28 Nov 1997, =?ISO-8859-1?Q?Johan_Myr=E9en?= wrote:

> > 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.

Yes, but at the same time we make sure that CR LF <--> CR munging only
happens for files with known text file extensions. This means that we
answer your concerns about getting binaries munged are already addressed.
Only text files get munged, not binaries. I think this answers the
concerns you voice below.

It would be nice if the fat driver was configurable for the list of file
name extensions that it would do conversion for.
Call the config file /etc/fat.conv or something, and in it have a list of
CR delimited (or CR LF :-) extensions that the driver will convert.
Then the fat driver can read the list at startup. At the moment, if you
want to change the list, you have to change the misc.c code and recompile
the kernel.

Maybe this is already how it works in 2.1. Not running
2.1.anything, I don't know. Yes, the patch was against 2.0.30.

Does 2.1 already work this way? If not, I'll send a new patch, this time
against 2.1.x Then if we can agree on a limited set of
file extensions as standard to include in fat.conv,
say .txt, .htm, .bat, .c, .h, .c++, .jav?

Cheers

Paul

>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?

------------------------------------------------------------------------------

,---
Paul Wilkins | o o |
Internet Operations Manager ` \_/ ' Linux
TMP Worldwide /\___/\ The Choice of
paulw@tmpw.com.au |_/ . \_| A GNU Generation
http://www.monsterboard.com.au \_/___\_/

------------------------------------------------------------------------------