From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: how having the basename of a file or directory Date: Mon, 31 Jan 2011 08:25:43 +0100 Message-ID: <8739o9ilfs.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296458775 26556 80.91.229.12 (31 Jan 2011 07:26:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 07:26:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 31 08:26:11 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pjo9L-0007CI-DD for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 08:26:11 +0100 Original-Received: from localhost ([127.0.0.1]:56282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjo9K-0002TE-QU for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 02:26:10 -0500 Original-Received: from [140.186.70.92] (port=41662 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjo98-0002T4-1o for emacs-devel@gnu.org; Mon, 31 Jan 2011 02:25:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pjo97-0005jk-5M for emacs-devel@gnu.org; Mon, 31 Jan 2011 02:25:57 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:36665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pjo96-0005jU-Tr for emacs-devel@gnu.org; Mon, 31 Jan 2011 02:25:57 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pjo95-00077D-7M for emacs-devel@gnu.org; Mon, 31 Jan 2011 08:25:55 +0100 Original-Received: from 63.211.85-79.rev.gaoland.net ([79.85.211.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Jan 2011 08:25:55 +0100 Original-Received: from thierry.volpiatto by 63.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Jan 2011 08:25:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 18 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 63.211.85-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.92 (gnu/linux) Cancel-Lock: sha1:W2fVpHq1M0GQY77X6fw3eevObN0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135269 Archived-At: Hi all, i didn't find any function giving the basename of a file or directory. I use this actually: (defun basename (fname) (if (file-directory-p fname) (let ((dirname (directory-file-name fname))) (file-relative-name dirname (file-name-directory dirname))) (file-name-nondirectory fname))) Does it exists already something i missed? -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997