[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: |
Andreas Schwab |
Subject: |
Re: how having the basename of a file or directory |
Date: |
Mon, 31 Jan 2011 13:53:45 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Thierry Volpiatto <address@hidden> writes:
> Andreas Schwab <address@hidden> writes:
>
>> Thierry Volpiatto <address@hidden> writes:
>>
>>> Andreas Schwab <address@hidden> writes:
>>>
>>>> Thierry Volpiatto <address@hidden> writes:
>>>>
>>>>> (file-name-nondirectory "path/to/a/directory")
>>>>> should return ==> directory
>>>>
>>>> It does.
>>> Not really.
>>> It does if PATH doesn't end with "/" otherwise no, it's why
>>
>> file-name-nondirectory doesn't care whether the argument is a directory
>> or not, it looks only at the contents of the string.
> Yes, i understood that, i am just pointing out that we should not have
> to take care if string end with / or not, like shell command basename.
file-name-nondirectory is not basename. The empty string is a valid
file name in Emacs.
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- how having the basename of a file or directory, Thierry Volpiatto, 2011/01/31
- Re: how having the basename of a file or directory, Stefan Monnier, 2011/01/31
- Re: how having the basename of a file or directory, Thierry Volpiatto, 2011/01/31
- Re: how having the basename of a file or directory, Karl Fogel, 2011/01/31
- Re: how having the basename of a file or directory, Stefan Monnier, 2011/01/31
- Re: how having the basename of a file or directory, Thierry Volpiatto, 2011/01/31