Mark -

I don't think that we should even be considering this option. In the Unix
world file extensions are meaningless to the operating system. They are
only useful to a human. The OS could care less. So I don't think we should
be making assumptions about the default/possible extensions that could be
in use on the system.

Remember, for files that are marked executable the OS shell looks at the
header info in the file to determine how to execute the file. The file
extension matters not at all.

Thanks,
W. David Ashley
IBM Systems and Technology Group Lab Services
Open Object Rexx Team
Mobile Phone: 512-289-7506



                                                                       
             "Mark Miesfeld"                                           
             <[EMAIL PROTECTED]                                         
             om>                                                        To
             Sent by:                  "ooRexx Dev List"               
             oorexx-devel-boun         <[email protected]
             [EMAIL PROTECTED]         >                               
             orge.net                                                   cc
                                                                       
                                                                   Subject
             06/26/2008 09:29          [Oorexx-devel] File search order in
             AM                        SysInterpreterInstance::resolveProg
                                       ramName()                       
                                                                       
             Please respond to                                         
             Open Object Rexx                                          
             Developer Mailing                                         
                   List                                                
             <[EMAIL PROTECTED]                                         
             ts.sourceforge.ne                                         
                    t>                                                 
                                                                       
                                                                       




Rick has done a great job of improving the search order algorithm for
external files.  There was a case that accidentally got dropped in
reworking the code.  That case is when the program file has no
extension.

I'm wondering where in the search order we should stick that in.  I
already committed a fix to the Windows code, but before I update the
Unix code, I thought we might want to discuss where in the order is
the proper place.

I stuck it immediately after the case where the program file already
has the extension.  Maybe though it should be last in the search?

My theory is that: before trying to search for a program file by
artificially adding an extension, you should try the file name as
given.  But, if most people don't use that case in the code they
write, maybe it should be the last case to search for?

Right now the Windows code is as below.  If we decide where in the
search order the case should go, I'll clean up the comment and add the
fix to the Unix code base.


    // if the file already has an extension, this dramatically reduces
the number
    // of searches we need to make.
    if (hasExtension(name))
    {
        if (searchName(name, searchPath.path, NULL, resolvedName))
        {
            return new_string(resolvedName);
        }
        return OREF_NULL;
    }

    // The file may purposefully have no extension.  Whether this search
should
    // come here, or last is debatable.
    if (searchName(name, searchPath.path, NULL, resolvedName))
    {
        return new_string(resolvedName);
    }

    // if we have a parent extension provided, use that in preference
to any default searches
    if (parentExtension != NULL)
    {
        if (searchName(name, searchPath.path, parentExtension,
resolvedName))
        {
            return new_string(resolvedName);
        }

    }

    // ok, now time to try each of the individual extensions along the way.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

<<inline: graycol.gif>>

<<inline: pic04446.gif>>

<<inline: ecblank.gif>>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to