No need to create another version of basename(), there's one available
drwxr-xr-x - cde