Menu

#165 SysFileTree Case independant filename matching

v3.2.0
closed
APIs (29)
5
2012-08-14
2007-05-02
Swifty
No

There seems to be no way (on systems with case sensitive filesystems) with SysFileTree of finding, for example *.jpg where "jpg" could be in any case.

The only mechanism seems to be to search for . then select the files that match *.jpg in REXX itself.

This can be very time consuming.

I would suggest adding "I" to the SysFileTree options, implying case-insensitive matching, in the same way that "I" implies case-insensitive sorting in SysStemSort.

Doing in SysFileTree should be faster than doing it in REXX.

I've been asked why the files are in varying case in the first place. They've been deposited in a public directory from a variety of case-independant systems, so we have no control of the case of the files.

Discussion

  • Rick McGuire

    Rick McGuire - 2007-05-03

    Logged In: YES
    user_id=1125291
    Originator: NO

    This is just an acknowlegement that your RFE has been received. This particular extension is going to require some discussion among the developers about whether it can or should be implemented.

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-05-04

    Logged In: YES
    user_id=191588
    Originator: NO

    I'm the one that encouraged Steve to open this RFE. I did that more to try and promote participation in the project than a belief it was a desperately needed enhancement. <grin>

    After a quick glance at the code, it looks doable to me. So, I think the question is more of is it something that should be done.

    I also guess I should move the discussion over to the developers list; it is not likely to be very visible here.

     
  • Lee Peedin

    Lee Peedin - 2007-05-04

    Logged In: YES
    user_id=1223125
    Originator: NO

    Consider this:
    Filespec says to find all files named "FOOBAR"

    Linux is perfectly happy with "different" files in the same folder having these names
    foobar -- lower case
    FOOBAR -- upper case
    FooBar -- camel case

    If a case insensitive SysFileTree is run, then all 3 of the above would match - which one is the correct one?

    My suggestion is to "honor" the case sensitivity of the Linux file system.

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-05-05

    Logged In: YES
    user_id=191588
    Originator: NO

    Lee,

    In your example of foobar, FOOBAR, and FooBar - there is no "correct" one. The 'correct' answer is all three.

    What Steve wants, is to be able to find all 3 files, without knowing ahead of time what the (case sensitive) spelling of any of them is. If he specifies *bar, he only gets one of them. Although, for what Steve really wants, this is a better example:

    pict.jpg
    myPict.JPG
    pictures.jpg
    seacoast.txt
    seacoast.Jpg
    doc.doc
    sample.txt
    README.first
    first.jPG

    He wants to use SysFileTree to pull all the *.jpg files out (no matter how the users have named their files.)

    I can see how people might find use for this. For instance, say in large source tree you want to gather up all the 'readme' files and do some processing on them. But, you don't know if the read me files are ReadMe, readme.first README, etc. A case insensitive search for readme would be userful. I had just this problem a few months ago with the Linux source tree.

    Of course there are ways to do this using standard Unix tools. But, some things are easier to do in ooRexx, for some people, than they are using sed, awk, and find. <grin.

     
  • Swifty

    Swifty - 2007-05-05

    Logged In: YES
    user_id=1364573
    Originator: YES

    I was going to say: Lee, you already have what you want - just miss the "I" off the sysfile options... :-)

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-05-17

    Logged In: YES
    user_id=191588
    Originator: NO

    This is implemented in SVN with revision 389.

     
  • David Ashley

    David Ashley - 2007-05-17

    Logged In: YES
    user_id=931756
    Originator: NO

    The docs are updated in SVN revision 390 for this RFE.

     

Anonymous
Anonymous

Add attachments
Cancel