| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| ooRexx 3.2.0 (6.02, 30 Oct 2007) under Win XP I've typically used code like the following to separate a leaf name from a preceding drive/path value. parse source . . execfulp /* eg: "C:\A\B C D\EF G.rex" */ lastbksl = lastpos("\",execfulp) /* eg: 11 */ execpath = substr(execfulp,1,lastbksl-1) /* eg: "C:\A\B C D" */ execname = substr(execfulp,lastbksl+1) /* eg: "EF G.rex" */ Is there anything to choose between that and using the BIF filespec() ? (I realise that filespec includes the \ at the end of the part portion whereas my code didn't.) Does filespec() do something sensible on non-Windows platforms? -- Jeremy C B Nicoll - my opinions are my own. |
|
#2
| |||
| |||
| Jeremy Nicoll - news posts wrote: > Is there anything to choose between that and using the BIF filespec() ? .... > Does filespec() do something sensible on non-Windows platforms? filespec() had some undesirable behavior, so I developed my own in the ObjectCUR class library, and before that the CUR function library. One was when it can not digest what it is asked to do, it returns a string '0'. For my implementation I also supported UNC as well as C:\foo I have vague memories that filespec() was even worse behaved on Linux than Windows. I have forgotten exact details as I use our version in the ObjectCUR class library, and I made it behave consistently between Linux/Windows handling both DOS, Linux, and UNC paths. -- Michael Lueck Lueck Data Systems http://www.lueckdatasystems.com/ |
|
#3
| |||
| |||
| On 5 Jul., 03:37, Michael Lueck <mlu...@lueckdatasystems.com> wrote: Hi Jeremy what about this... parse source . . execfulp parse value execfulp~Reverse() with execname '\' execpath execpath = execpath~Reverse() execname = execname~Reverse() .... Martin |
|
#4
| |||
| |||
| In <gemini.k3i3ba00h9cts00vc@wingsandbeaks.org.uk.inv alid>, on 07/04/2008 at 10:21 PM, Jeremy Nicoll - news posts <jn.nntp.scrap001@wingsandbeaks.org.uk> said: >Does filespec() do something sensible on non-Windows platforms? Yes. -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to spamtrap@library.lspace.org |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.