Mail Archives: djgpp-workers/1998/09/17/08:50:41
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
- Raw text -