Sender: Vik DOT Heyndrickx AT rug DOT ac DOT be Message-ID: <3601055A.6993@rug.ac.be> Date: Thu, 17 Sep 1998 14:49:30 +0200 From: Vik Heyndrickx MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: auto-binary-mode? References: <199809152120 DOT RAA08510 AT delorie DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk DJ Delorie wrote: > > Hey, I just had an idea. When a file is opened and the first block is > read in, if the user didn't specify binary or text, why not look at > the data and try to guess? The presence of null, control, or certain > 8-bit characters should indicate binary vs text as a default. I've had this idea too (see the archives), but the problems seems to be that the guessing once in a while will fail to work as others pointed out. What about this suggestion: Keep a directory of filenames within one special db-file along with extra information indicating whether a file is true binary, unixy text or DOS text. Whenever a call to fopen (et al.) is issued, fopen searches this directory to know the nature of the file. A possible extension would be to store LFN aliases for 8+3 fns. -- \ Vik /-_-_-_-_-_-_/ \___/ Heyndrickx / \ /-_-_-_-_-_-_/ Knight in the Order of the Unsigned Types