First complete version of dirname.py