On Tue, Nov 22, 2011 at 09:36, Twan van Laarhoven <twanvl@gmail.com> wrote:
On 21/11/11 02:36, Ben Gamari wrote:
On the whole, the filepath package does an excellent job of providing
basic path manipulation tools, one weakness is the inability to resolve
"~/..." style POSIX paths. Python implements this with
os.path.expanduser. Perhaps a similar function might be helpful in
filepath?

On windows there are folders like %UserProfile% and %ProgramFiles%. There is a function in the API, ExpandEnvironmentStrings, for expanding them.

On Unix/POSIX, environment variables in file paths are typically not handled as widely as tilde expansion, or by the same facilities (for one thing, envar expansion is applicable to general strings, not just file paths; I think this is also true on Windows).  This is not to say that such a facility shouldn't exist in the standard libraries, but that filepath isn't really the place for it.

--
brandon s allbery                                      allbery.b@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms