I've been thinking a bit about explode_path(). Despite the fact that I don't like the function anyway, I think it could be made at least slightly useful if the semantics was changed so that
combine_path(@explode_path(X)) == combine_path(X)
(I think this is how things originally worked, but since then combine_path has been updated to behave more logically. :)
For UNIX, the only change would be that explode_path("/foo/bar") would return ({ "/", "foo", "bar" }) instead of ({ "", "foo", "bar" }). For AmigaOS and possibly W*ndows, the impact would be a bit larger.
The problem is of course that code which does f(explode_path(X))*"/" will break. OTOH, it doesn't seem like the docs say that this should work in the first place... Maybe the old behaviour should be retained by #pike 7.4...
Well, nobody protested so I made the change (keeping the old behaviour for -V7.4). :-) Actually, the only effect for old code which does f(explode_path(X))*"/" is that absolute paths will get an extra slash at the beginning; i.e. explode_path("/foo/bar")*"/" becomes "//foo/bar". This works under UNIX, but W*ndows probably won't like it.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-01-12 22:11: Subject: explode_path
I've been thinking a bit about explode_path(). Despite the fact that I don't like the function anyway, I think it could be made at least slightly useful if the semantics was changed so that
combine_path(@explode_path(X)) == combine_path(X)
(I think this is how things originally worked, but since then combine_path has been updated to behave more logically. :)
For UNIX, the only change would be that explode_path("/foo/bar") would return ({ "/", "foo", "bar" }) instead of ({ "", "foo", "bar" }). For AmigaOS and possibly W*ndows, the impact would be a bit larger.
The problem is of course that code which does f(explode_path(X))*"/" will break. OTOH, it doesn't seem like the docs say that this should work in the first place... Maybe the old behaviour should be retained by #pike 7.4...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
i like the new behaviour, i mean, what's the point of a function that just does the same as path/"/"; ?
greetings, martin.
pike-devel@lists.lysator.liu.se