Index: openacs-4/packages/xotcl-core/tcl/dav-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/Attic/dav-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/xotcl-core/tcl/dav-procs.tcl 20 Jul 2018 15:07:43 -0000 1.1 +++ openacs-4/packages/xotcl-core/tcl/dav-procs.tcl 21 Jul 2018 11:37:19 -0000 1.2 @@ -1,5 +1,5 @@ ::xo::library doc { - XoWiki - dav procs. Simple WebDAV implementation to access files in the wiki via the + XoTcl - dav procs. Simple WebDAV implementation to access files in the wiki via the WebDAV protocol. @creation-date 2010-04-10 @@ -378,7 +378,7 @@ # abstract method to return properties of a file } - :method log {msg} {if {$::xowiki::davStmlog} {ns_log notice "dav::stm: $msg"}} + :method log {msg} {if {$::xo::davStmlog} {ns_log notice "dav::stm: $msg"}} } } Index: openacs-4/packages/xotcl-core/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/utilities-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xotcl-core/tcl/utilities-procs.tcl 21 Jul 2018 11:37:19 -0000 1.1 @@ -0,0 +1,52 @@ +::xo::library doc { + + XoTcl - Utility procs + +} + +namespace eval ::xo { + + proc read_file {fn} { + set F [open $fn] + fconfigure $F -translation binary + set content [read $F] + close $F + return $content + } + + proc write_file {fn content} { + set F [::open $fn w] + ::fconfigure $F -translation binary -encoding binary + ::puts -nonewline $F $content + ::close $F + } + + nsf::proc ::xo::get_raw_request_body {-as_string:switch -as_file:switch} { + if {$as_string eq $as_file} { + error "either -as_string or -as_file must be specified" + } + set contentfile [ns_conn contentfile] + if {$as_file} { + # + # If the file was not spooled, obtained it via [ns_conn content] + # as write it to a file. + # + if {$contentfile eq ""} { + set contentfile [ad_tmpnam] + write_file $contentfile [ns_conn content -binary] + } + set result $contentfile + } else { + # + # Return the result as a string + # + if {$contentfile eq ""} { + set result [ns_conn content -binary] + } else { + set result [read_file $contentfile] + } + } + return $result + } + +} Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -N -r1.54 -r1.55 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 26 Jun 2018 10:25:30 -0000 1.54 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 21 Jul 2018 11:37:19 -0000 1.55 @@ -388,45 +388,18 @@ } proc read_file {fn} { - set F [open $fn] - fconfigure $F -translation binary - set content [read $F] - close $F - return $content + ns_log warning "::xowiki::write_file deprecated. Use ::xo::write_file instead" + return [::xo::read_file $fn] } + proc write_file {fn content} { - set F [::open $fn w] - ::fconfigure $F -translation binary -encoding binary - ::puts -nonewline $F $content - ::close $F + ns_log warning "::xowiki::write_file deprecated. Use ::xo::write_file instead" + return [::xo::write_file $fn $content] } nsf::proc ::xowiki::get_raw_request_body {-as_string:switch -as_file:switch} { - if {$as_string eq $as_file} { - error "either -as_string or -as_file must be specified" - } - set contentfile [ns_conn contentfile] - if {$as_file} { - # - # If the file was not spooled, obtained it via [ns_conn content] - # as write it to a file. - # - if {$contentfile eq ""} { - set contentfile [ad_tmpnam] - write_file $contentfile [ns_conn content -binary] - } - set result $contentfile - } else { - # - # Return the result as a string - # - if {$contentfile eq ""} { - set result [ns_conn content -binary] - } else { - set result [read_file $contentfile] - } - } - return $result + ns_log warning "::xowiki::get_raw_request_body deprecated. Use ::xo::get_raw_request_body instead" + return [::xo::get_raw_request_body -as_string $as_string_p -as_file $as_file_p] } proc ::xowiki::page_order_uses_ltree {} {