Product Site

5.4.8.33. name

Returns the name portion of the receiver object's absolute path. This is everything after the last path separator. The file's extension is part of the name.

See also method extension.
Example 5.260. File class — name method
/* On Windows */
say .File~new("c:\program files\oorexx\rexx.exe")~name   -- rexx.exe
say .File~new("c:\")~name                                -- empty string

/* On Unix-like system */
say .File~new("/usr/local/lib/rexx.img")~name            -- rexx.img
say .File~new("/")~name                                  -- empty string