Product Site

5.4.8.34. 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.261. File class — 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-like system */
say .File~new("/opt/ooRexx/bin/rexx.img")~parent           -- /opt/ooRexx/bin
say .File~new("/")~parent                                  -- The NIL object