Subject: Re: CRLF fun stuff again...
From: Marc J. Miller (itlm019@mailbox.ucdavis.edu)
Date: Sat Feb 10 2001 - 22:43:36 EST
At 10:18 AM 2/10/01 +0000, Duncan Sinclair wrote:
>You know a file is text by two indicators:
>   1) Its file type is TEXT.
>   2) It has an extension which tells netatalk it is text.
>
>These two indicators cover files created by Macs and files created
>by Unix, repectively.
Okay, I agree with the former, but the latter is a little more 
complicated.  String compares are slow.  For each file copied, the name has 
to be checked against the following list (and this is just off the top of 
my head)
.txt
.htm
.html
.c
.pl
.ksh
.sh
.cc
.p
.bat
.vbs
.asc
.ans
.cgi
.troff
.am
.cfg
(you get the idea)  There are also file extensions like .sys which are 
sometimes text (config.sys and msdos.sys, for example) and sometimes binary 
(cdrom.sys, ansi.sys, and msdos.sys in versions of DOS before Windows 
95).  File extensions are a guide to the user for guessing the file 
type.  I've observed that most Unix and Mac people don't use file 
extensions at all.  The scripts in /etc/rc.d/init.d on Red Hat systems 
don't have extensions, yet they're all text.  Mac folks seem to be quite 
used to relying on the icon of the file.  Ever tried to save an HTML file 
in Netscape and then edit it in SimpleText?  Many versions of SimpleText 
won't open it at all because Mac is so dependent on the resource 
information to tell it what programs should be able to open it.  File 
extensions were introduced through DOS, really.  Unix and MacOS see the "." 
in the file name as just a character.
It may be possible to work with some library that the "file" command uses 
for identifying file types (if it uses a library), but as I'm not 
interested in activating the CRLF feature in the first place, I'll let 
someone else look that up.  :)
This archive was generated by hypermail 2b28 : Sun Oct 14 2001 - 03:04:32 EDT