help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Path Operations: Concatenation (concat), Extraction of sub-paths, etc.


From: Nordlöw
Subject: Path Operations: Concatenation (concat), Extraction of sub-paths, etc.
Date: 26 Apr 2007 08:53:15 -0700
User-agent: G2/1.0

Hey again, Emacs Powerusers!

I am looking for convenience functions for path operations, typically

- concatenation of paths: (path-concat "/usr/" "/lib") => "/usr/lib/"
- extraction of sub-paths: (path-before "/usr/lib/" "/lib/") => "usr/"
- extraction of sub-paths: (path-after "/usr/lib/X11" "lib") => "X11/"
- full path to local file name: (path-local "/etc/passwd") => "passwd"
- full path to containing directory path: (path-dir "/etc/passwd") =>
"/etc/"

If possible results should be standardized/canonicalized, that is
- directories always end with "/"
- non-absolute paths always begin directly with the top-most directory
name without the "/"


/Nordlöw



reply via email to

[Prev in Thread] Current Thread [Next in Thread]