From: Mike C. <MF...@uk...> - 2007-04-16 10:51:07
|
I think the thing to do is simply don't use an unembellished name in the search (unless the calling program has no extension). At present (under Windows), if the calling program is called foo.myedit then a function call to fred() will invoke foo.myedit or (if that's not found) foo.rex. That seems the correct behaviour, and is what the doc says... [Don't seem to be able to get to the bug report page today :-(] Mike - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mike Cowlishaw, IBM Fellow IBM UK (MP8), PO Box 31, Birmingham Road, Warwick, CV34 5JL mailto:mf...@uk... -- http://www2.hursley.ibm.com/mfcsumm.html "Rick McGuire" <obj...@gm...> Sent by: oor...@li... 16/04/2007 10:52 Please respond to Open Object Rexx Developer Mailing List <oor...@li...> To "Open Object Rexx Developer Mailing List" <oor...@li...> cc Subject Re: [Oorexx-devel] Nasty Shock from CALL on Linux The code as currently implemented uses the following search order: 1) Check if the name is already qualified by an extenstion. If it is, disable any further extension searches. 2) Search for the name as is, looking first in the current directory, then on the path. 3) Lowercase the name, and repeat 2) >>>> This is the step that locates /usr/bin/write. 4) Iterate though a provided list of extensions. I believe this list contains the extension of the current program + ".REX". 5) Perform the same search used in 2) and 3) with each extension added. I suspect the best fix would be to at a minimum, open the located file and see if it starts with the "ELF" signature and skip the file. We might also want to reject any hash-bang lines that are not Rexx. I don't have a working linux build system to tackle this, so somebody else with some linux skills is going to have to step up to this one. Rick On 4/16/07, Mike Cowlishaw <MF...@uk...> wrote: Rony wrote: > Here's the documentation on how the searching order is defined as: Thanks! (I did look in the ooRexx Ref but under CALL.) > The name of internal routines must not be specified as a literal string, > that is, in quotation marks, whereas the name of built-in functions or > external routines must be specified in quotation marks. [Name of BIFs must be in quotation marks?] > 5. Rexx functions in the current directory, with the current extension. > 6. Rexx functions along environment PATH, with the current extension. > 7. Rexx functions in the current directory, with the default extension > (.REX or .CMD). > 8. Rexx functions along environment PATH, with the default extension > (.REX or .CMD). > So the question would be, what is the "current extension" and what would > be your "current directory". > > Assuming that the current extension is ".rex" and the current directory > is the one where your program runs which creates the content, then you > should not run into the described problem? It would seem so. So this is a bug :-). I'll add to database -- thanks for finding the above. > Even if the programs are in different directories, if you use the same > "current extension" and have changed the PATH to first look in the > directories you specify, "/usr/bin/write" should not be found before > "write.rex". I agree :-). In fact there's nothing to suggest that a name without extension is allowed. > However, one could infer that in your call "write" does not possess any > extension, hence looking for "write" will rightfully find > "/usr/bin/write". (Although this behaviour has probably been introduced > with the fix to look for lowercase named filenames on Linux, the problem > would still be the same on Windows, if someone would have e.g. cygwin > installed with a "write" command.) Hmm, interesting... :-) Mike Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Oorexx-devel mailing list Oor...@li... https://lists.sourceforge.net/lists/listinfo/oorexx-devel ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Oorexx-devel mailing list Oor...@li... https://lists.sourceforge.net/lists/listinfo/oorexx-devel Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |