Index: openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl,v
diff -u -r1.66.2.8 -r1.66.2.9
--- openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 11 Jul 2020 11:56:09 -0000 1.66.2.8
+++ openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 13 Jul 2020 12:02:33 -0000 1.66.2.9
@@ -884,7 +884,7 @@
as follows:
- return -code ok or "return"
- - With a plain return, a non-empty return value will be lappended to
+
- With a plain return, a nonempty return value will be lappended to
the list of returns from the callback function
- return -code error or "error"
@@ -905,7 +905,7 @@
- return -code break
- return the current list of returned values including this implementations
- return value if non-empty
+ return value if nonempty
- return -code continue
- Continue processing, ignore the return value from this implementation
@@ -924,7 +924,7 @@
@param args pass the set of arguments on to each callback
- @return list of the returns from each callback that does a normal (non-empty) return
+ @return list of the returns from each callback that does a normal (nonempty) return
@see ad_proc
} {
@@ -1018,7 +1018,7 @@
ad_proc -public acs_package_root_dir { package_key } {
Returns the path root for a particular package within the OpenACS installation.
- For example /web/yourserver/packages/foo, i.e., a full file system path with no ending slash.
+ For example /web/yourserver/packages/foo, i.e., a full filesystem path with no ending slash.
} -
ad_proc -public ad_make_relative_path { path } {
@@ -1130,7 +1130,28 @@
return [ns_config ns/server/[ns_info server]/acs WithDeprecatedCode 1]
}
+ad_proc ad_file {subcmd arg1 args} {
+
+ Tcl supports csh-style tilde substitution. If a filename starts
+ with a tilde, then the filename will be interpreted as if the
+ first element is replaced with the location of the home directory
+ for the given user. If the user does not exist, an exception is
+ raised. (e.g. [file dirname ~gustafn.foo]).
+
+ https://www.tcl-lang.org/man/tcl/TclCmd/filename.htm#M20
+ This little proc can be used in cases, where (a) the
+ tilde-substitution is unwanted, and where the "name" argument
+ (usually the first argument after the subcommand) might contain
+ user provided values.
+
+} {
+ if {[string range $arg1 0 1] eq {~}} {
+ set arg1 ./$arg1
+ }
+ ::file $subcmd $arg1 {*}$args
+}
+
# Local variables:
# mode: tcl
# tcl-indent-level: 4