- Subject: Re: dircat vs. path_concat
- From: "Klaus Schmid" <klaus.schmid@xxxxxxx>
- Date: Wed, 15 Oct 2003 23:20:33 +0200
> Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
[...]
>But I would write it a little bit different:
[...]
> I don't know the syntax of VMS paths and I don't know what is valid, but
> dircat("d:foo.bar", "") brings "d:foo.bar]"
For dircat I think a few syntax rules are sufficient.
Very roughly:
x:a + b --> undefined
a + b --> []a + b
x]a + b --> x.a]b
I think dircat works (or should work) the same way as path_concat.
An obvious difference is the expand_filename() at the end of dircat;
I don't know why this was introduced into dircat.
Personally I would prefer to have one set of path-functions to
match all. First a set of functions to split an input-string into
two substrings, realized dependant on os-type:
(dir,base)= split_file( file)
(core,extv)= split_base( base)
(ext,v)= split_extv( extv)
Then two basic functions to navigate through the directory tree,
realized os-type-dependant:
(d,b)= dir_up( dir)
dir= dir_down( d,b)
e.g.:
split_file( "a:[b]c.txt") --> "a:[b]", "c.txt"
dir_down( "a:[b]", "c.dir") --> "a:[b.c]"
dir_up( "a:[b.c]") --> "a:[b]", "c.dir"
For compatibiliy, the existing functions could be rewritten
in SLang or C by referring to this basic functions.
One UNIX-detail I am almost sure cannot be transposed to VMS:
"a" == "a/." == "a/b/.."
Obviously dirname may output a dot, but does not respect these
'free' dots at input very well -- are they important/useful anyway?
-- Klaus
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]