Filetype setting on fopen
nick at dsvr.net
Tue Aug 6 03:13:10 PDT 2002
Peter Naulls wrote:
> 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
OK. I see what you're getting at.
> 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.
It doesn't seem worth 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.
I'll probably just add a explicity set file type command to 'as' and
Development Manager, Designer Servers Ltd. http://www.dsvr.co.uk
More information about the gcc