__unixify_ext

Alex Waugh alex at alexwaugh.com
Wed Nov 9 13:53:58 PST 2005


In message <0bbdf6c54d.peter at chocky.org>
          Peter Naulls <peter at chocky.org> wrote:

> 
> I've added a new function to my UnixLib, __unixify_ext, which is a
> helper to disambiguate unqualified input filenames to a program, based
> upon a given filename extension.   This is for programs which look at
> their input filename closely, and can become upset at being handed a
> RISC OS filename.
> 
> You can see an example of its use in the bzip2 patch I'm about to check
> in.  I'd appreciate any comments.

Presumably it searches the filename for the given extension, and if
found uses the dot or slash preceding it to make the decision?

What about doing a mimemap lookup on the final segment of the filename,
and if it matches assume it is the extension? That would be more
general purpose, but potentially more complex/unexpected behaviour.

Alex

-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/




More information about the gcc mailing list