Index: openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 9 Nov 2018 13:18:17 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/proxy-procs.tcl 3 Sep 2024 15:37:34 -0000 1.9 @@ -16,11 +16,14 @@ ad_proc -public proxy::exec { {-call:required} {-cd} + {-ignorestderr:boolean} } { Execute the statement in a proxy instead of normal exec @param call Call which is passed to the "exec" command @param cd Change to the given directory before executing the command + @param ignorestderr Boolean value to indicate, whether the stderr output + of the exec'ed command should be ignored. } { set start_time [clock clicks -milliseconds] set handle [ns_proxy get ExecPool] @@ -39,8 +42,10 @@ set pwd [ns_proxy eval $handle pwd] ns_proxy eval $handle [list cd $cd] } - set return_string [ns_proxy eval $handle [list ::exec {*}$call]] + set exec_flags [expr {$ignorestderr_p ? "-ignorestderr --" : ""}] + set return_string [ns_proxy eval $handle [list ::exec {*}$exec_flags {*}$call]] } finally { + if {[info exists pwd]} { # # Switch back to the previous directory. @@ -53,9 +58,16 @@ } # Now rename exec; protect cases, where file is loaded multiple times - if {[info commands ::real_exec] eq ""} {rename exec real_exec} + if {[namespace which ::real_exec] eq ""} { + rename exec real_exec + } - ad_proc exec {args} {This is the wrapped version of exec} {proxy::exec -call $args} + ad_proc exec {-ignorestderr:boolean -- args} { + This is the wrapped version of exec + } { + proxy::exec -ignorestderr=$ignorestderr_p -call $args + } + } # Local variables: