all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kai Grossjohann <kai@emptydomain.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Path Operations: Concatenation (concat), Extraction of sub-paths, etc.
Date: Fri, 27 Apr 2007 08:47:24 +0200	[thread overview]
Message-ID: <86lkgeb9fn.fsf@ketchup.de.uu.net> (raw)
In-Reply-To: 1177602795.646518.293300@o40g2000prh.googlegroups.com

Nordlöw <per.nordlow@gmail.com> writes:

> - concatenation of paths: (path-concat "/usr/" "/lib") => "/usr/lib/"

Not exactly, but close: expand-file-name

> - extraction of sub-paths: (path-before "/usr/lib/" "/lib/") => "usr/"

Not exactly, but close, perhaps: file-name-directory,
file-name-nondirectory.

> - extraction of sub-paths: (path-after "/usr/lib/X11" "lib") => "X11/"

See above.

> - full path to local file name: (path-local "/etc/passwd") => "passwd"

file-name-nondirectory

> - full path to containing directory path: (path-dir "/etc/passwd") =>
> "/etc/"

file-name-directory

> If possible results should be standardized/canonicalized, that is
> - directories always end with "/"

file-name-as-directory

> - non-absolute paths always begin directly with the top-most directory
> name without the "/"

Hm.  There must be a function to strip leading "./" and "/./" in the
middle, but I don't know what it is.  There is file-truename which
might do this as a side effect.

Kai

  reply	other threads:[~2007-04-27  6:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26 15:53 Path Operations: Concatenation (concat), Extraction of sub-paths, etc Nordlöw
2007-04-27  6:47 ` Kai Grossjohann [this message]
     [not found] ` <mailman.2578.1177656828.7795.help-gnu-emacs@gnu.org>
2007-04-30  5:10   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86lkgeb9fn.fsf@ketchup.de.uu.net \
    --to=kai@emptydomain.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.