Filetype setting on fopen

Ian Jeffray ian at
Tue Aug 6 01:47:25 PDT 2002

Nick Burrett wrote:

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

I don't think that's a good idea.  It should still save it as
"index/html" but also set the filetype. Reason being, if I save 
"index.html" from, say, nano running in RISC OS, I DO want the filename
as "index/html" on disc... having the filetype set for me is just a
nice bonus. Can I run through some examples of what I'd like to see:

index.html        index/html  (faf - from mimemap)
index.html        index/html  (fff - no mime file)         index/foo   (fff - mimetype lookup fails)
index             index       (fff - no ext so no mime lookup)

The following requested by Alex but I don't know where they'd
be used (it's AcornNFS server-side notation, not for unixlib
apps to be generating names like this)

index.html,abc    index/html  (abc - explicit filetype override mime)
index,abc         index       (abc - explicit filetype)

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

Possibly... but I doubt anyone will have/want ".o -> ffd" mapping in
their MimeMap, so maybe if a mime lookup fails, we have some simple
internal tables to add on rules like that?


More information about the gcc mailing list