renamed PathName to FileName in the Unix tradition
fixed a bug when getting the parent of a dir path