#98 Make FILESPEC a method!!!

Rejected
closed
nobody
5
2012-08-14
2007-01-10
suprhulk
No

Every variable supports virtually every "method" except for "value", "directory" and "filespec".

The first two obviously can not be made methods as they are functions which return/set values.

However, "FILESPEC" is just a special string parser, that returns one of three specific substrings, so it should be easy to add as a base method.

E.G.

sDrive = 'd:\flintstone\fred.txt"~filespec('d')

say 'sDrive="'sDrive'"' / "d:" /

sPath = 'd:\flintstone\fred.txt"~filespec('p')

say 'sPath="'sPath'"' / "\flintstone\" /

sName = 'd:\flintstone\fred.txt"~filespec('n')

say 'sName="'sName'"' / "fred.txt" /

This way I can write code that conforms to the "messaging" that ooRexx methods implement such as:

if sFileSpec~filespec('n')~translate() = 'FRED.TXT'...

Instead of:

if filespec('n',sFileSpec)~translate() = 'FRED.TXT'...

RickH

P.S. Besides the 'N' option, add something like 'F' for "Filename without extension" and "X" for "eXtension". Not much use for those OSes which don't use ".ext" as a loose, and I do mean LOOSE, association with what module can or can not process the file but it would be useful for those of us who are forced to pay attention to the file extension.

Discussion

  • Rick McGuire
    Rick McGuire
    2007-06-14

    Logged In: YES
    user_id=1125291
    Originator: NO

    Filespec does not really belong as a base method of the string class. It only has meaning on platforms where a hierarchical filesystem is used with "extensions". A function like this might have good meaning on something like a "File" class, where the data being manipulated/requested is a characteristic of a file. It just doesn't belong on String.

     
  • Rick McGuire
    Rick McGuire
    2007-06-14

    Logged In: YES
    user_id=1125291
    Originator: NO

    Notice: This RFE is slated to be rejected.

    Reason: See the RFE item in the SourceForge Tracker system for the rejection reason.

    To appeal this rejection please contact the Appeals Committee via Mr. Chip Davis

    oorexx-rfe-appeals@oorexx.org

    All further correspondence on this RFE should be directed to the Appeals Committee and MUST include this RFE number.

    The decision of the Appeals Committee is final.

     
  • Rick McGuire
    Rick McGuire
    2007-06-14

    Logged In: YES
    user_id=1125291
    Originator: NO

    Notice: This RFE is slated to be rejected.

    Reason: See the RFE item in the SourceForge Tracker system for the rejection reason.

    To appeal this rejection please contact the Appeals Committee via Mr. Chip Davis

    oorexx-rfe-appeals@oorexx.org

    All further correspondence on this RFE should be directed to the Appeals Committee and MUST include this RFE number.

    The decision of the Appeals Committee is final.

     
  • Rick McGuire
    Rick McGuire
    2007-07-16

    Logged In: YES
    user_id=1125291
    Originator: NO

    This RFE has now passed the 30-day mark since rejection without appeal. This RFE is now closed.

     


Anonymous


Cancel   Add attachments