tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David N. Welton)
Subject Re: web::getfilename
Date Tue, 25 Jun 2002 10:05:55 GMT
Ronnie Brunner <> 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 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

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

Back to packing my stuff,
David N. Welton
Free Software:
   Apache Tcl:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message