tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: web::getfilename
Date Tue, 25 Jun 2002 10:05:55 GMT
Ronnie Brunner <ronnie@netcetera.ch> writes:

> > How does the idea of 

> > proc web::getfilename {filename} {
> >     return [file join [file dirname [web::config script]] $filename]
> > }

> > strike you guys?  I think this could be a huge stumbling block for
> > people ("how do I load a ^*&^ file!?"), and having it built in would
> > be helpful...

> I don't really see what you get with this. (What do you mean by
> "load a file"?) The rpoble is that it might be confused with an
> accessor to the path in the file system from a "URL" on the server:
> e.g. something like from "/index.html" to
> "/my/path/to/docs/index.html", but that's not what it's about (in
> this case it would actually return /index.x.html).

> If you really talk about loading such as [load $file] or [source
> $file], I don't think that people need much help: they either use
> absolute paths or they know how to deal with [web::config script] or
> similar.

> But I might be missing the point ...

I think part of the point is that absolute paths suck - they make it
hard to move your code to another site.  For example, the
tcl.apache.org site itself has to run both locally, so that I (we) can
test it out, as well as on the main box.  It currently does this
without much trouble at all.

[web::config script] is ok, but my thought was to provide something
that's easier, instead of doing the [file ....] routine above every
time.

The thing that worries me is that people are going to come to us in
droves asking "how do I access files relatively?".  I see this bit of
code as an easy answer.  I don't care about the name... just something
simple.

Back to packing my stuff,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Mime
View raw message