[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how having the basename of a file or directory
From: |
Stephen J. Turnbull |
Subject: |
Re: how having the basename of a file or directory |
Date: |
Tue, 01 Feb 2011 20:55:05 +0900 |
Thierry Volpiatto writes:
> (file-name-nondirectory "path/to/a/directory")
> should return ==> directory
> (file-name-nondirectory "path/to/a/file")
> should return ==> file
They do.
(file-name-nondirectory "path/to/a/directory/") => ""
is the problem.
> So modifying `file-name-nondirectory'
This is probably out of the question. It should be the case that
(equal fname (concat (file-name-directory fname)
(file-name-nondirectory fname))))
> or creating a basename function
Un-Pythonic. But then, this isn't Python, so I guess it's OK. ;-)
- Re: how having the basename of a file or directory,
Stephen J. Turnbull <=