unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* how having the basename of a file or directory
@ 2011-01-31  7:25 Thierry Volpiatto
  2011-01-31  8:30 ` Stephen J. Turnbull
  0 siblings, 1 reply; 18+ messages in thread
From: Thierry Volpiatto @ 2011-01-31  7:25 UTC (permalink / raw)
  To: emacs-devel

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 




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-02-02 12:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31  7:25 how having the basename of a file or directory Thierry Volpiatto
2011-01-31  8:30 ` Stephen J. Turnbull
2011-01-31  8:59   ` Thierry Volpiatto
2011-01-31 10:28     ` Andreas Schwab
2011-01-31 11:03       ` Thierry Volpiatto
2011-01-31 12:07         ` Andreas Schwab
2011-01-31 12:19           ` Thierry Volpiatto
2011-01-31 12:53             ` Andreas Schwab
2011-01-31 15:29     ` Stefan Monnier
2011-01-31 16:30       ` Thierry Volpiatto
2011-01-31 16:43         ` Karl Fogel
2011-01-31 19:53         ` Stefan Monnier
2011-01-31 20:39           ` Thierry Volpiatto
2011-02-01 11:55     ` Stephen J. Turnbull
2011-02-01 15:37       ` Karl Fogel
2011-02-01 16:26         ` Stephen J. Turnbull
2011-02-01 16:52           ` Karl Fogel
2011-02-02 12:27             ` Stephen J. Turnbull

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).