Filetype setting on fopen

Peter Naulls peter at chocky.org
Tue Aug 6 02:05:27 PDT 2002


In message <3D4F87D0.7040206 at dsvr.net>
          Nick Burrett <nick at dsvr.net> wrote:

> Peter Naulls wrote:
> > What do people think of this?
> > 
> > When a file is created (with fopen/open), its type is set depending upon
> > its extension.  so .html gets 0xFAF etc.  The lookup is the normal
> > Mimetype lookup of course.   Behaviour would be controlled via an
> > additional flag to the current riscosify settings.  Should it be
> > default?  I can't think of any reason why not.
> > 
> > I have a number of programs that would benefit from this, and it would
> > allow the only RISC OS specific changes to be removed.
> 
> This looks like a good idea to me.
> 
> I'm assuming that index.html will be saved as "index" with the file type 
> set to 0xfaf, rather than as index.html with the file type set to 0xfaf.

It's not what I had in mind.  The extension would be retained, as I can
forsee problems when trying to reload stuff - unless you want to match
the reverse direction - or when transferring stuff to unix filesystems.
Plus there's issues with name clashes - file.txt vs file.html

If you want to do this, I think it would be best if this were a
different flag - I don't however intend to implement it.

> We could use this feature to fix the other silly GCC features of saving
> AOF/ALF files as text files.

Possibly, if you wanted to add a mapping for .o to your mimemap to data
type - peronsally, I have no problem with them being text typed.


-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 Homepage                     -  http://www.chocky.org/
 RISC OS C Programming        -  http://www.riscos.info/
 Unix Programs on RISC OS     -  http://www.chocky.org/unix/
------------------------------------------------------------------------



More information about the gcc mailing list