Product SiteDocumentation Site

5.4.25.26. parent


>>-parent------------------------------------------------------><

Returns the parent directory portion of the receiver object's absolute path. If no separator is found or the absolute path ends with a separator (which means this is a root path) then returns .nil.

Example 5.213. Class FILE - parent method


/* On Windows */
say .File~new("c:\program files\oorexx\rexx.exe")~parent   -- c:\program files\oorexx
say .File~new("c:\")~parent                                -- The NIL object
say .File~new("c:")~parent                                 -- The NIL object

/* On Unix */
say .File~new("/opt/ooRexx/bin/rexx.img")~parent           -- /opt/ooRexx/bin
say .File~new("/")~parent                                  -- The NIL object