jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: proposal 'file string functions'


On Sat, 30 Mar 2002 13:43:00 +0100 wrote ks <klaus.schmid@xxxxxx>:

> Model/Terminology:
> 
>   File == Path + Base
> 
>   Path=="" and Base=="" should be legal.

I also appreciate Path + Base for path_concat (Path, Base) but
there is a problem: if I have a directory name without the trailing / or \
(Unix/Dos), how do I get it "canonized"?

Example: When I ask for a path to store a file, I will not require the user
to give the "canonical" directory name.

> Overloaded functions:
> 
>   Get path n levels higher and down to B1, B2, ... BM
>   
>     Path= file_path( File, n, B1, B2, ... BM)
> 
>   Get base n levels higher
>   
>     Base= file_base( File, n)

No need for overloading, just optional arguments.

And the answer to my above question would be

   Path = file_path(Path, 1, file_base(Path));
   
Well, file_path(Path, 1, file_base(Path)) + Base;
is no longer simpler than path_concat (Path, Base);.
      

> I think these functions would be easier to read,
> remind and use. What do you think?

Maybe they would (Especially for the one who wrote them -- which should be a
fairly easy task in Slang :-). 

OTHOH, most of the functionality is present in the path_* functions.
Substituting them would require changes to many many of my scripts...

Guenter


--
G.Milde@xxxxxxxxxxxxxxxxxxxx


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]