Add method to get name of file or directory