Index: openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info,v diff -u -r1.45.2.1 -r1.45.2.2 --- openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 16 Nov 2019 15:45:55 -0000 1.45.2.1 +++ openacs-4/packages/acs-bootstrap-installer/acs-bootstrap-installer.info 13 Jul 2020 12:02:33 -0000 1.45.2.2 @@ -9,7 +9,7 @@ f t - + Don Baccus Bootstraps an OpenACS installation. 2017-08-06 @@ -18,7 +18,7 @@ GPL 3 - + Index: openacs-4/packages/acs-bootstrap-installer/installer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer.tcl,v diff -u -r1.31.2.3 -r1.31.2.4 --- openacs-4/packages/acs-bootstrap-installer/installer.tcl 24 Nov 2019 11:03:38 -0000 1.31.2.3 +++ openacs-4/packages/acs-bootstrap-installer/installer.tcl 13 Jul 2020 12:02:33 -0000 1.31.2.4 @@ -108,7 +108,7 @@ lappend missing_params $mandatory_params_array($param_name) } } else { - # Form is non-empty + # Form is nonempty # Loop over all params set all_param_names [concat [array names mandatory_params_array] \ Index: openacs-4/packages/acs-bootstrap-installer/installer/tcl/zz-postload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/tcl/zz-postload.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-bootstrap-installer/installer/tcl/zz-postload.tcl 7 Aug 2017 23:47:46 -0000 1.3 +++ openacs-4/packages/acs-bootstrap-installer/installer/tcl/zz-postload.tcl 13 Jul 2020 12:02:33 -0000 1.3.2.1 @@ -34,7 +34,8 @@ # the subdirectory and it would not be searched. proc __is_xql {arg} { - return [expr {[file isdirectory $arg] || [file extension $arg] eq ".xql"}]} + return [expr {[file isdirectory $arg] || [file extension $arg] eq ".xql"}] +} # We need to load query files for the top-level stuff in www and Tcl # dirs is the list of directories to walk for xql files. Packages .xql 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 Index: openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl,v diff -u -r1.16.2.3 -r1.16.2.4 --- openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 24 Nov 2019 11:03:39 -0000 1.16.2.3 +++ openacs-4/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl 13 Jul 2020 12:02:33 -0000 1.16.2.4 @@ -85,7 +85,7 @@ # # 2. There was no checking to make sure that *all* pools are correctly # configured. Even in an Oracle-only environment one could easy mistype a - # user name or the like for one of the pools set aside for ACS use, and + # username or the like for one of the pools set aside for ACS use, and # this would not be cleanly caught and reported. # # 3. There was no checking to make sure that *all* pools are of the same RDBMS Index: openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl,v diff -u -r1.50.2.1 -r1.50.2.2 --- openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl 10 Mar 2019 22:04:51 -0000 1.50.2.1 +++ openacs-4/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl 13 Jul 2020 12:02:33 -0000 1.50.2.2 @@ -76,7 +76,7 @@ } else { set components_lesser $components } - set extension [file extension $path] + set extension [ad_file extension $path] set type "" @@ -94,7 +94,7 @@ if {$extension eq ".sql"} { if { [lsearch -glob $components "*upgrade-*-*"] >= 0 } { set type "data_model_upgrade" - } elseif { [regexp -- "^$package_key-(create|drop)\.sql\$" [file tail $path] "" kind] } { + } elseif { [regexp -- "^$package_key-(create|drop)\.sql\$" [ad_file tail $path] "" kind] } { set type "data_model_$kind" } else { set type "data_model" @@ -133,7 +133,7 @@ set type "include_page" } elseif { $extension eq ".tcl" && [lindex $components_lesser 0] eq "tcl" } { # A .tcl file residing under dir .../package_key/tcl/ - if { [regexp -- {-(procs|init)(-[0-9a-zA-Z]*)?\.tcl$} [file tail $path] "" kind] } { + if { [regexp -- {-(procs|init)(-[0-9a-zA-Z]*)?\.tcl$} [ad_file tail $path] "" kind] } { if {[lindex $components end-1] eq "test"} { set type "test_$kind" } else { @@ -190,7 +190,9 @@ if {$all_p} { set file_function "" } else { - set file_function [expr {$include_data_model_files_p ? "apm_include_data_model_file_p" : "apm_include_file_p"}] + set file_function [expr {$include_data_model_files_p + ? "apm_include_data_model_file_p" + : "apm_include_file_p"}] } set files [lsort [ad_find_all_files -check_file_func $file_function $package_path]] # We don't assume db_type proc is defined yet @@ -249,8 +251,9 @@ } ad_proc -public apm_is_catalog_file { file_path } { - Given a file path return 1 if - the path represents a message catalog file and 0 otherwise. + + Given a file path return 1 if the path represents a message + catalog file and 0 otherwise. @param file_path Should be absolute or relative to OpenACS /packages dir or one of its parent dirs. @@ -303,7 +306,7 @@ 2. Other files. - If it is a tcl, xql, or sqlj file not under the sql dir and whose name + If it is a .tcl, .xql, or .sqlj file not under the "sql" dir and whose name ends in a dash and database type, the file is assumed to be specific to that database type. @@ -330,8 +333,8 @@ } return "oracle" } - - set file_name [file tail $path] + + set file_name [ad_file tail $path] foreach known_database_type $::acs::known_database_types { if { [regexp -- "\-[lindex $known_database_type 0]\.(xql|tcl|sqlj)\$" $file_name match] } { return [lindex $known_database_type 0] @@ -357,7 +360,7 @@ # We need to add that information back into the .info files. set package_path [acs_package_root_dir $package_key] - return [expr {![file exists "${package_path}/sql"] || [file exists "${package_path}/sql/[db_type]"]}] + return [expr {![ad_file exists "${package_path}/sql"] || [ad_file exists "${package_path}/sql/[db_type]"]}] } ad_proc -public apm_source { __file {errorVarName ""}} { @@ -371,7 +374,7 @@ array set errors [list] } - if { ![file exists $__file] } { + if { ![ad_file exists $__file] } { ns_log "Error" "Unable to source $__file: file does not exist." return 0 } @@ -388,7 +391,7 @@ return 0 } - nsv_set apm_library_mtime $r_file [file mtime $__file] + nsv_set apm_library_mtime $r_file [ad_file mtime $__file] return 1 } @@ -398,7 +401,7 @@ ad_proc -private apm_bootstrap_load_file { root_directory file {errorVarName ""}} { Source a single file during initial bootstrapping and set APM data. } { - ns_log "Notice" "Loading [file tail $root_directory]/$file" + ns_log "Notice" "Loading [ad_file tail $root_directory]/$file" if {$errorVarName ne ""} {upvar $errorVarName errors} apm_source ${root_directory}/${file} errors } @@ -493,7 +496,7 @@ } { set fn [apm_install_xml_file_path] # Abort if there is no install.xml file - if { ![file exists $fn] } { + if { ![ad_file exists $fn] } { return "" } @@ -522,11 +525,11 @@ Currently, a file is ignored if it is a backup file or a CVS directory. } { - if {[file isdirectory $path]} { + if {[ad_file isdirectory $path]} { # # ignored directories # - set parts [file split $path] + set parts [ad_file split $path] if {[lindex $parts end] eq "resources" && [lindex $parts end-1] eq "www"} { return 1 } @@ -547,11 +550,14 @@ if {!$data_model_files_p} { lappend extension_list ".sql" } - if {[file extension $path] in $extension_list} { + if {[ad_file extension $path] in $extension_list} { return 1 } - - if { [apm_backup_file_p [file tail $path]] } { + + if { [string index $path 0] eq "~"} { + set path ./$path + } + if { [apm_backup_file_p [ad_file tail $path]] } { return 1 } @@ -560,8 +566,8 @@ ad_proc -private apm_backup_file_p { path } { - Returns 1 if $path is a backup file, or 0 if not. We consider it a backup file if - any of the following apply: + Returns 1 if $path is a backup file, or 0 if not. We consider it a + backup file if any of the following apply:
  • its name begins with # @@ -614,7 +620,7 @@ # that, e.g. 0-acs-tcl has to be split up into two parts: (a) # setup of variables, and (b) sourcing everything. # - # source $::acs::rootdir/tcl/[file tail $file] + # source $::acs::rootdir/tcl/[ad_file tail $file] } set source $::acs::rootdir/packages/acs-bootstrap-installer/installer/www foreach file [glob -nocomplain $source/*tcl $source/*adp] { Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v diff -u -r1.49.2.1 -r1.49.2.2 --- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 14 Aug 2019 07:13:35 -0000 1.49.2.1 +++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 13 Jul 2020 12:02:33 -0000 1.49.2.2 @@ -641,7 +641,7 @@ # remove the prepended "/packages/" string regsub {^\/?packages\/} $relative_path {} relative_path - # remove the last chunk of the file name, since we're just looking for the root path + # remove the last chunk of the filename, since we're just looking for the root path # NOTE: THIS MAY NEED BETTER ABSTRACTION, since this assumes a naming scheme # of -rdbms.XXX (ben) regsub {\.xql} $relative_path {} relative_path Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -r1.95.2.14 -r1.95.2.15 --- openacs-4/packages/acs-tcl/acs-tcl.info 6 Jun 2020 09:47:48 -0000 1.95.2.14 +++ openacs-4/packages/acs-tcl/acs-tcl.info 13 Jul 2020 12:02:33 -0000 1.95.2.15 @@ -9,7 +9,7 @@ f t - + OpenACS The Kernel Tcl API library. 2017-08-06 @@ -18,8 +18,8 @@ GPL version 2 3 - - + + Index: openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl,v diff -u -r1.1.2.14 -r1.1.2.15 --- openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 3 Jul 2020 07:27:28 -0000 1.1.2.14 +++ openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 13 Jul 2020 12:02:33 -0000 1.1.2.15 @@ -2777,8 +2777,8 @@ oracle { set user_pass [db_get_sql_user -dbn $dbn] - cd [file dirname $file] - set fp [open "|[file join $::env(ORACLE_HOME) bin sqlplus] $user_pass @$file" "r+"] + cd [ad_file dirname $file] + set fp [open "|[ad_file join $::env(ORACLE_HOME) bin sqlplus] $user_pass @$file" "r+"] fconfigure $fp -buffering line puts $fp "exit" @@ -2792,7 +2792,7 @@ } postgresql { - set file_name [file tail $file] + set file_name [ad_file tail $file] set pguser [db_get_username] if { $pguser ne "" } { @@ -2825,7 +2825,7 @@ } set errno [catch { - cd [file dirname $file] + cd [ad_file dirname $file] set fp [open "|[file join [db_get_pgbin] psql] $pghost $pgport $pguser -f $file [db_get_database] $pgpass" "r"] } errorMsg] @@ -2916,9 +2916,9 @@ puts $fd1 $file_contents close $fd1 - cd [file dirname $file] + cd [ad_file dirname $file] - set fd [open "|[file join $::env(ORACLE_HOME) bin sqlldr] userid=$user_pass control=$tmpnam" "r"] + set fd [open "|[ad_file join $::env(ORACLE_HOME) bin sqlldr] userid=$user_pass control=$tmpnam" "r"] while { [gets $fd line] >= 0 } { # Don't bother writing out lines which are purely whitespace. @@ -3027,7 +3027,7 @@ @param dbn The database name to use. If empty_string, uses the default database. } { set user_pass [db_get_sql_user -dbn $dbn] - set fp [open "|[file join $::env(ORACLE_HOME) bin loadjava] -verbose -user $user_pass $file" "r"] + set fp [open "|[ad_file join $::env(ORACLE_HOME) bin loadjava] -verbose -user $user_pass $file" "r"] # Despite the fact that this works, the text does not get written to the stream. # The output is generated as an error when you attempt to close the input stream as @@ -3513,7 +3513,7 @@ switch -- $original_type { blob_get_file { - if {[file exists $content]} { + if {[ad_file exists $content]} { file copy -- $content $file return $selection } else { @@ -3523,7 +3523,7 @@ write_blob { - if {[file exists $content]} { + if {[ad_file exists $content]} { set ofp [open $content r] fconfigure $ofp -encoding binary ns_writefp $ofp @@ -3620,7 +3620,7 @@ if {[info exists storage_type]} { switch -- $storage_type { file { - if {[file exists $content]} { + if {[ad_file exists $content]} { set ifp [open $content r] # DRB: this could be made faster by setting the buffersize @@ -3650,7 +3650,7 @@ error "invalid storage type" } } - } elseif {[file exists $content]} { + } elseif {[ad_file exists $content]} { set ifp [open $content r] fconfigure $ifp -translation binary set data [read $ifp] @@ -3668,7 +3668,7 @@ if {[info exists storage_type]} { switch -- $storage_type { file { - if {[file exists $content]} { + if {[ad_file exists $content]} { file copy -- $content $file } else { error "file: $content doesn't exist" @@ -3687,7 +3687,7 @@ error "invalid storage type" } } - } elseif {[file exists $content]} { + } elseif {[ad_file exists $content]} { file copy -- $content $file } elseif {[regexp {^[0-9]+$} $content match]} { ns_pg blob_select_file $db $content $file @@ -3707,7 +3707,7 @@ if {[info exists storage_type]} { switch -- $storage_type { file { - if {[file exists $content]} { + if {[ad_file exists $content]} { set ofp [open $content r] fconfigure $ofp -encoding binary ns_writefp $ofp @@ -3733,7 +3733,7 @@ error "invalid storage type" } } - } elseif {[file exists $content]} { + } elseif {[ad_file exists $content]} { set ofp [open $content r] fconfigure $ofp -encoding binary ns_writefp $ofp Index: openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl,v diff -u -r1.13.2.1 -r1.13.2.2 --- openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl 22 Nov 2019 16:21:43 -0000 1.13.2.1 +++ openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl 13 Jul 2020 12:02:33 -0000 1.13.2.2 @@ -43,7 +43,7 @@ set files "upgrade-5.9.1d10-5.9.1d11.sql" foreach file $files { set fn $kernelSqlDir/$file - if {[file readable $fn]} { + if {[ad_file readable $fn]} { ns_log notice "bootstrap: upgrading SQL file $fn" db_source_sql_file -callback apm_dummy_callback $fn } Index: openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl 18 Apr 2018 20:58:59 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl 13 Jul 2020 12:02:33 -0000 1.5.2.1 @@ -127,8 +127,8 @@ set tcl_code [doc_adp_compile $adp_code] } else { set reparse_p 0 - set mtime [file mtime $file_name] - set size [file size $file_name] + set mtime [ad_file mtime $file_name] + set size [ad_file size $file_name] # See whether the file has been cached, i.e., the __doc_adp_cache_info,$file_name # proc has been declared. If it has, the proc will return a two-element list Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl,v diff -u -r1.45.2.2 -r1.45.2.3 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 3 Jul 2020 07:27:28 -0000 1.45.2.2 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 13 Jul 2020 12:02:33 -0000 1.45.2.3 @@ -32,8 +32,8 @@ Return the path to the apm-workspace, creating the directory if necessary. } { - set path [file join $::acs::rootdir apm-workspace] - if { [file isdirectory $path] } { + set path [ad_file join $::acs::rootdir apm-workspace] + if { [ad_file isdirectory $path] } { return $path } else { return [apm_mkdir $path] @@ -47,7 +47,7 @@ } { set base_path [apm_workspace_dir] set install_path "$base_path/install" - if { [file isdirectory $install_path] } { + if { [ad_file isdirectory $install_path] } { return $install_path } else { return [apm_mkdir $install_path] @@ -111,7 +111,7 @@ } else { set path $path/$package_key } - if { [file exists $path/$package_key.info] } { + if { [ad_file exists $path/$package_key.info] } { return $path/$package_key.info } error "The directory $path does not contain a package specification file ($package_key.info)." @@ -467,7 +467,7 @@ set h [ns_http queue -timeout $timeout:0 $url] set replyHeaders [ns_set create] ns_http wait -file F -headers $replyHeaders -spoolsize 1 $h - if {[file exists $output_file_name]} {file delete -- $output_file_name} + if {[ad_file exists $output_file_name]} {file delete -- $output_file_name} file rename -- $F $output_file_name set location [ns_set iget $replyHeaders location] if {$location eq ""} break @@ -540,7 +540,7 @@ return } - if {![file exists $file_path]} { + if {![ad_file exists $file_path]} { apm_callback_and_log $callback " The file cannot be found. Your URL or your filename is incorrect. Please verify that the filename is correct and try again." @@ -553,7 +553,7 @@ if { [catch { set files [split [string trim \ [exec [apm_gzip_cmd] -d -q -c -S .apm $file_path | [apm_tar_cmd] tf - 2> [apm_dev_null]]] "\n"] - apm_callback_and_log $callback "
  • Done. Archive is [format %.1f [expr { [file size $file_path] / 1024.0 }]]KB, with [llength $files] files.
  • " + apm_callback_and_log $callback "
  • Done. Archive is [format %.1f [expr { [ad_file size $file_path] / 1024.0 }]]KB, with [llength $files] files.
  • " } errmsg] } { apm_callback_and_log $callback "The follow error occurred during the uncompression process:
    [ns_quotehtml $errmsg]

    @@ -582,7 +582,7 @@ return } - if { [llength $components] == 2 && [file extension $file] eq ".info" } { + if { [llength $components] == 2 && [ad_file extension $file] eq ".info" } { if { [info exists info_file] } { apm_callback_and_log $callback "The archive contains more than one package/*/*.info file, so it is not a valid APM file.
\n" ns_log Error "Error loading APM file form url $url: Invalid APM file. More than one package .info file." @@ -607,7 +607,7 @@ #exec sh -c "cd $tmpdir ; [apm_gzip_cmd] -d -q -c -S .apm $file_path | [apm_tar_cmd] xf - $info_file" 2> [apm_dev_null] if { [catch { - array set package [apm_read_package_info_file [file join $tmpdir $info_file]] + array set package [apm_read_package_info_file [ad_file join $tmpdir $info_file]] } errmsg]} { file delete -force -- $tmpdir apm_callback_and_log $callback "The archive contains an unparsable package specification file: @@ -631,7 +631,7 @@ } else { set install_path [apm_workspace_install_dir] - if { ![file isdirectory $install_path] } { + if { ![ad_file isdirectory $install_path] } { file mkdir $install_path } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.126.2.7 -r1.126.2.8 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 3 Jul 2020 07:27:28 -0000 1.126.2.7 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 13 Jul 2020 12:02:33 -0000 1.126.2.8 @@ -34,8 +34,8 @@ # Loop through all directories in the /packages directory, searching each for a # .info file. foreach dir [lsort [glob -nocomplain "$path/*"]] { - set package_key [file tail $dir] - if { ![file isdirectory $dir] } { + set package_key [ad_file tail $dir] + if { ![ad_file isdirectory $dir] } { continue } if { [apm_ignore_file_p $dir] } { @@ -800,7 +800,7 @@ # Backup any existing (old) package in packages dir first set old_package_path [acs_package_root_dir $package_key] - if { [file exists $old_package_path] } { + if { [ad_file exists $old_package_path] } { util::backup_file -file_path $old_package_path } @@ -809,7 +809,7 @@ # We moved the spec file, so update its path set package_path $old_package_path - set spec_file_path [apm_package_info_file_path -path [file dirname $package_path] $package_key] + set spec_file_path [apm_package_info_file_path -path [ad_file dirname $package_path] $package_key] } ad_try { @@ -1010,7 +1010,7 @@ } - if {[file exists $::acs::rootdir/packages/$package_key/install.xml]} { + if {[ad_file exists $::acs::rootdir/packages/$package_key/install.xml]} { # # Run install.xml only for new installs # @@ -1477,7 +1477,7 @@ ns_log Debug "apm_package_install_spec: Checking existence of package directory." set root [acs_package_root_dir $package_key] - if { ![file exists $root] } { + if { ![ad_file exists $root] } { file mkdir $root # doesn't work under windows. its not very useful anyway. # file attributes $root -permissions [parameter::get -parameter InfoFilePermissionsMode -default 0755] @@ -1498,7 +1498,7 @@ # create minimal directories foreach dir {www www/doc tcl tcl/test sql sql/postgresql sql/oracle} { set path "[acs_package_root_dir $package_key]/$dir" - if { ![file exists $path] } { + if { ![ad_file exists $path] } { file mkdir $path } } @@ -2186,7 +2186,7 @@ # Abort if there is no install.xml file set filename $::acs::rootdir$filename - if { ![file exists $filename] } { + if { ![ad_file exists $filename] } { error "File $filename not found" } Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.114.2.12 -r1.114.2.13 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 3 Jul 2020 07:27:28 -0000 1.114.2.12 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 13 Jul 2020 12:02:33 -0000 1.114.2.13 @@ -389,8 +389,8 @@ # If the file exists, and either has never been loaded or has an mtime # which differs the mtime it had when last loaded, mark to be loaded. - if { [file isfile $full_path] } { - set mtime [file mtime $full_path] + if { [ad_file isfile $full_path] } { + set mtime [ad_file mtime $full_path] if { $force_reload_p || (![nsv_exists apm_library_mtime $relative_path] || [nsv_get apm_library_mtime $relative_path] != $mtime @@ -481,8 +481,8 @@ set full_path "[acs_package_root_dir $package_key]/$file" # If $file had a different mtime when it was last loaded, return # needs_reload. (If the file should exist but doesn't, just skip it.) - if { [file exists $full_path] - && [file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"] + if { [ad_file exists $full_path] + && [ad_file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"] } { return "needs_reload" } @@ -498,8 +498,8 @@ set full_path "[acs_package_root_dir $package_key]/$file" # If $file had a different mtime when it was last loaded, return # needs_reload. (If the file should exist but doesn't, just skip it.) - if { [file exists $full_path] - && [file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"] + if { [ad_file exists $full_path] + && [ad_file mtime $full_path] ne [nsv_get apm_library_mtime "packages/$package_key/$file"] } { return "needs_reload" } @@ -718,7 +718,7 @@ } { set dirs [list] lappend dirs $path - foreach subdir [glob -nocomplain -type d [file join $path *]] { + foreach subdir [glob -nocomplain -type d [ad_file join $path *]] { lappend dirs {*}[apm_subdirs $subdir] } return $dirs @@ -749,9 +749,9 @@ set path "$::acs::rootdir/$file" ns_log Debug "APM: File being watched: $path" - if { [file exists $path] + if { [ad_file exists $path] && (![nsv_exists apm_library_mtime $file] - || [file mtime $path] ne [nsv_get apm_library_mtime $file]) + || [ad_file mtime $path] ne [nsv_get apm_library_mtime $file]) } { lappend files_to_reload $file } @@ -898,7 +898,7 @@ if { ![info exists reloaded_files($file)] } { # File is usually of form packages/package_key set file_path "$::acs::rootdir/$file" - set file_ext [file extension $file_path] + set file_ext [ad_file extension $file_path] switch -- $file_ext { .tcl { # Make sure this is not a -init.tcl file as those should only be sourced on server startup Index: openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl,v diff -u -r1.33.2.3 -r1.33.2.4 --- openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 3 Jul 2020 07:27:29 -0000 1.33.2.3 +++ openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 13 Jul 2020 12:02:33 -0000 1.33.2.4 @@ -219,7 +219,7 @@ } { # If the .info file hasn't changed since last read (i.e., has the same # mtime), return the cached info list. - set mtime [file mtime $path] + set mtime [ad_file mtime $path] if { [nsv_exists apm_version_properties $path] } { set cached_version [nsv_get apm_version_properties $path] if { [lindex $cached_version 0] == $mtime } { Index: openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl,v diff -u -r1.29.2.4 -r1.29.2.5 --- openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 1 Nov 2019 13:16:18 -0000 1.29.2.4 +++ openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 13 Jul 2020 12:02:33 -0000 1.29.2.5 @@ -1105,13 +1105,13 @@ set start [clock clicks -milliseconds] - set dir [file dirname $filename] + set dir [ad_file dirname $filename] while { [string length $dir] > 1 && [string first $path_root $dir] == 0 } { # Only look in directories under the path root. if { [file isfile "$dir/master.adp"] } { return "$dir/master.adp" } - set dir [file dirname $dir] + set dir [ad_file dirname $dir] } if { [file exists "$path_root/templates/master.adp"] } { @@ -2609,11 +2609,11 @@ } if {[info exists file]} { - if {![file exists $file]} { + if {![ad_file exists $file]} { error "Error reading file: $file not found" } - if {![file readable $file]} { + if {![ad_file readable $file]} { error "Error reading file: $file permission denied" } @@ -2623,7 +2623,7 @@ close $fp if {![info exists filename]} { - set filename [file tail $file] + set filename [ad_file tail $file] } if {$mime_type eq "*/*" || $mime_type eq ""} { Index: openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl,v diff -u -r1.30.2.2 -r1.30.2.3 --- openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 3 Jul 2020 07:27:29 -0000 1.30.2.2 +++ openacs-4/packages/acs-tcl/tcl/http-client-procs.tcl 13 Jul 2020 12:02:33 -0000 1.30.2.3 @@ -637,16 +637,16 @@ return -code error "${this_proc}: No file specified" } set file [dict get $f file] - if {![file exists $file]} { + if {![ad_file exists $file]} { return -code error "${this_proc}: Error reading file: $file not found" } - if {![file readable $file]} { + if {![ad_file readable $file]} { return -code error "${this_proc}: Error reading file: $file permission denied" } dict set f filename [expr {[dict exists $f filename] ? [dict get $f filename] : - [file tail $file]}] + [ad_file tail $file]}] } # Filename and fieldname must be in the file dict at this @@ -830,7 +830,7 @@ if {$file eq ""} { set content_size [string length $content] } else { - set content_size [file size $file] + set content_size [ad_file size $file] } # Content size seems ok. Now try applying encoding Index: openacs-4/packages/acs-tcl/tcl/json-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/json-procs.tcl,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-tcl/tcl/json-procs.tcl 25 Jul 2018 21:19:26 -0000 1.11 +++ openacs-4/packages/acs-tcl/tcl/json-procs.tcl 13 Jul 2020 12:02:33 -0000 1.11.2.1 @@ -396,7 +396,7 @@ lappend values "\"$key\":[util::json::gen_inner $val]" } } - return "\{[join $values ,]\}" + return "\{[ns_dbquotelist $values]\}" } ad_proc -private util::json::array2json {arrayVal} { @@ -414,7 +414,7 @@ lappend values [util::json::gen_inner $val] } } - return "\[[join $values ,]\]" + return "\[[ns_dbquotelist $values]\]" } ad_proc util::json::gen {value} { Index: openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl 6 Sep 2019 16:00:31 -0000 1.4.2.2 +++ openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl 13 Jul 2020 12:02:33 -0000 1.4.2.3 @@ -45,7 +45,7 @@ } file delete -- $tmp_html_filename - if {[file exists $tmp_pdf_filename]} { + if {[ad_file exists $tmp_pdf_filename]} { return $tmp_pdf_filename } else { return "" @@ -73,7 +73,7 @@ if {[catch {exec $htmldoc_bin --webpage --quiet -t pdf -f $tmp_pdf_filename $tmp_html_filename} err]} { ns_log Error "Error during conversion from html to pdf: $err" } - if {[file exists $tmp_pdf_filename]} { + if {[ad_file exists $tmp_pdf_filename]} { return $tmp_pdf_filename } else { return "" @@ -97,7 +97,7 @@ @return item_id } { - set file_size [file size $pdf_file] + set file_size [ad_file size $pdf_file] set item_id [cr_import_content -title $title -description $description $folder_id $pdf_file $file_size application/pdf $title] return $item_id } Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -r1.153.2.22 -r1.153.2.23 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 3 Jul 2020 07:27:29 -0000 1.153.2.22 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 13 Jul 2020 12:02:33 -0000 1.153.2.23 @@ -397,7 +397,7 @@ # Loop through the files, adding a row to the table for each. foreach file [lsort [glob -nocomplain $dir/*]] { - set tailHtml [ns_quotehtml [file tail $file]] + set tailHtml [ns_quotehtml [ad_file tail $file]] set link "$tailHtml" # Build the stat array containing information about the file. @@ -509,22 +509,22 @@ # performance etc. and is therefore commented out. # set path "packages/$package_key/www/resources/$resource" # set themed_path [template::resource_path -type templates -style $path] - # if { [file isfile $themed_path] } { + # if { [ad_file isfile $themed_path] } { # return [rp_serve_resource_file $themed_path] # } set path "[acs_package_root_dir $package_key]/www/resources/$resource" - if { [file isfile $path] } { + if { [ad_file isfile $path] } { return [rp_serve_resource_file $path] } set path $::acs::rootdir/www/[ns_conn url] - if { [file isfile $path] } { + if { [ad_file isfile $path] } { return [rp_serve_resource_file $path] } set path [acs_package_root_dir acs-subsite]/www/[ns_conn url] - if { [file isfile $path] } { + if { [ad_file isfile $path] } { return [rp_serve_resource_file $path] } @@ -1213,7 +1213,7 @@ @see rp_internal_redirect } { if {[string index $path end] eq "/"} { - if { [file isdirectory $path] } { + if { [ad_file isdirectory $path] } { # The path specified was a directory; return its index file. # Directory name with trailing slash. Search for an index.* file. @@ -1225,30 +1225,30 @@ } else { # If there's a trailing slash on the path, the URL must refer to a - # directory (which we know doesn't exist, since [file isdirectory $path] + # directory (which we know doesn't exist, since [ad_file isdirectory $path] # returned 0). ad_raise notfound } } ### no more trailing slash. - if { [file isfile $path] } { + if { [ad_file isfile $path] } { # It's actually a file. ad_conn -set file $path } else { # The path provided doesn't correspond directly to a file - we # need to glob. (It could correspond directly to a directory.) - if { ![file isdirectory [file dirname $path]] } { + if { ![file isdirectory [ad_file dirname $path]] } { ad_raise notfound } ad_conn -set file [rp_concrete_file -extension_pattern $extension_pattern $path] if { [ad_conn file] eq "" } { - if { [file isdirectory $path] && !$noredirect_p } { + if { [ad_file isdirectory $path] && !$noredirect_p } { # Directory name with no trailing slash. Redirect to the same # URL but with a trailing slash. @@ -1275,7 +1275,7 @@ ad_proc -public rp_serve_concrete_file {file} { Serves a file. } { - set extension [file extension $file] + set extension [ad_file extension $file] set startclicks [clock clicks -microseconds] if { [nsv_exists rp_extension_handlers $extension] } { @@ -1332,7 +1332,7 @@ perform its own checks, if any. } { # first check that we are not serving a forbidden file like a .xql, a backup or CVS file - if {[file extension $path] eq ".xql" + if {[ad_file extension $path] eq ".xql" && ![parameter::get -parameter ServeXQLFiles -package_id $::acs::kernel_id -default 0] } { # Can't use ad_return_exception_page because it depends upon an initialized ad_conn ns_log Warning "An attempt was made to access an .XQL resource: {$path}." Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.141.2.20 -r1.141.2.21 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 6 Jun 2020 09:24:43 -0000 1.141.2.20 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 13 Jul 2020 12:02:33 -0000 1.141.2.21 @@ -1006,13 +1006,13 @@ if { $parent_node(package_key) ne "" } { # Find all the page or directory names under this package foreach path [glob -nocomplain -types d "[acs_package_root_dir $parent_node(package_key)]/www/*"] { - lappend existing_urls [lindex [file split $path] end] + lappend existing_urls [lindex [ad_file split $path] end] } foreach path [glob -nocomplain -types f "[acs_package_root_dir $parent_node(package_key)]/www/*.adp"] { - lappend existing_urls [file rootname [lindex [file split $path] end]] + lappend existing_urls [file rootname [lindex [ad_file split $path] end]] } foreach path [glob -nocomplain -types f "[acs_package_root_dir $parent_node(package_key)]/www/*.tcl"] { - set name [file rootname [lindex [file split $path] end]] + set name [file rootname [lindex [ad_file split $path] end]] if { $name ni $existing_urls } { lappend existing_urls $name } @@ -2188,7 +2188,7 @@ } { set ns_conn_url [ns_conn url] set subsite_get_url [subsite::get_url] - set joined_url [file join $subsite_get_url $ns_conn_url] + set joined_url [ad_file join $subsite_get_url $ns_conn_url] # join drops ending slash for some cases. Add back if appropriate. if { [string index $ns_conn_url end] eq "/" && [string index $joined_url end] ne "/" } { append joined_url "/" Index: openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl,v diff -u -r1.4.2.3 -r1.4.2.4 --- openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl 27 Mar 2020 09:01:00 -0000 1.4.2.3 +++ openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl 13 Jul 2020 12:02:33 -0000 1.4.2.4 @@ -35,8 +35,8 @@ regsub {/$} $name /index name set fullname [ad_tmpdir]/ns_saved$name.html ns_log notice "before-ns_return: save content of ns_return to file:$fullname" - set dirname [file dirname $fullname] - if {![file isdirectory $dirname]} { + set dirname [ad_file dirname $fullname] + if {![ad_file isdirectory $dirname]} { file mkdir $dirname } set f [open $fullname w] Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.189.2.55 -r1.189.2.56 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 3 Jul 2020 07:27:29 -0000 1.189.2.55 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 13 Jul 2020 12:02:33 -0000 1.189.2.56 @@ -63,9 +63,9 @@ # # Split the source # - if {[file isfile $source]} { - set filename [file tail $source] - set in_path [file dirname $source] + if {[ad_file isfile $source]} { + set filename [ad_file tail $source] + set in_path [ad_file dirname $source] } else { set filename "." set in_path $source @@ -2340,7 +2340,7 @@ if {$lastchar eq "/" } { return $path } else { - set file_dirname [file dirname $path] + set file_dirname [ad_file dirname $path] # Treat the case of the root directory special if {$file_dirname eq "/" } { return / @@ -2828,7 +2828,7 @@ # dots other than in file extension are dangerous. Put inside two # '#' character will be seen as message keys and file-storage is # currently set to interpret them. - set str_ext [file extension $str] + set str_ext [ad_file extension $str] set str_noext [string range $str 0 end-[string length $str_ext]] regsub -all {\.} $str_noext $replace_with str_noext set str ${str_noext}${str_ext} @@ -3701,7 +3701,7 @@ set backup_path "${file_path}${backup_suffix}.${backup_counter}" } - if { ![file exists $backup_path] } { + if { ![ad_file exists $backup_path] } { # We found a non-existing backup path break } @@ -4048,11 +4048,11 @@ set filename [lindex [split $file "/"] end] set file_extension [lindex [split $filename "."] end] - if { [file isfile $file] } { + if { [ad_file isfile $file] } { if {$extension eq "" || $file_extension eq $extension} { lappend files [list $filename $file] } - } elseif { [file isdirectory $file] } { + } elseif { [ad_file isdirectory $file] } { if { $include_dirs == 1 } { lappend files $file } @@ -4120,9 +4120,9 @@ } } foreach dir $searchdirs { - set fullname [file join $dir $prog] + set fullname [ad_file join $dir $prog] foreach ext $exts { - if {[file executable $fullname$ext]} { + if {[ad_file executable $fullname$ext]} { return $fullname$ext } } @@ -4334,9 +4334,9 @@ set hash [ns_sha1 $call] set dir [ad_tmpdir]/oacs-cache/$key set file_name $dir/$id-$hash - if {![file isdirectory $dir]} {file mkdir $dir} + if {![ad_file isdirectory $dir]} {file mkdir $dir} ns_mutex eval [nsv_get ad_disk_cache mutex] { - if {[file readable $file_name]} { + if {[ad_file readable $file_name]} { set result [template::util::read_file $file_name] } else { set result [{*}$call] @@ -4516,7 +4516,7 @@ catch {set dot [::util::which dot]} if {$dot ne ""} { set dir [ad_tmpdir]/oacs-dotcode - if {![file isdirectory $dir]} { + if {![ad_file isdirectory $dir]} { file mkdir $dir } # @@ -4531,7 +4531,7 @@ # set dot_signature [ns_md5 $dot_code-svg-$css] set stem $dir/$dot_signature - if {![file exists $stem.svg]} { + if {![ad_file exists $stem.svg]} { ns_log notice "inline_svg_from_dot: generate $stem.svg" set f [open $stem.dot w]; puts $f $dot_code; close $f @@ -4549,7 +4549,7 @@ } else { ns_log notice "inline_svg_from_dot: reuse $stem.svg" } - if {[file exists $stem.svg]} { + if {[ad_file exists $stem.svg]} { set f [open $stem.svg]; set svg [read $f]; close $f # # Delete the first three lines generated from dot. @@ -4615,7 +4615,7 @@ if {[dict exists $resource_info downloadURLs]} { ns_log notice "we have downloadURLs <[dict get $resource_info downloadURLs]>" foreach url [dict get $resource_info downloadURLs] { - lappend downloadFiles [file tail $url] + lappend downloadFiles [ad_file tail $url] } } set files [concat \ @@ -4631,7 +4631,7 @@ } else { set path $resource_dir/$version_dir/$file } - if {![file readable $path/]} { + if {![ad_file readable $path/]} { set installed 0 break } @@ -4655,7 +4655,7 @@ set can_install 1 set resource_dir [dict get $resource_info resourceDir] - if {![file isdirectory $resource_dir]} { + if {![ad_file isdirectory $resource_dir]} { try { file mkdir $resource_dir } on error {errorMsg} { @@ -4664,14 +4664,14 @@ } if {$can_install && $version_dir ne ""} { set path $resource_dir/$version_dir - if {![file isdirectory $path]} { + if {![ad_file isdirectory $path]} { try { file mkdir $path } on error {errorMsg} { set can_install 0 } } else { - set can_install [file writable $path] + set can_install [ad_file writable $path] } } return $can_install @@ -4709,7 +4709,7 @@ append local_path /$version_dir append download_prefix /$version_dir } - if {![file writable $local_path]} { + if {![ad_file writable $local_path]} { file mkdir $local_path } @@ -4734,16 +4734,16 @@ } else { error "download from $download_prefix/$file failed: $result" } - set local_root [file dirname $local_path/$file] - if {![file isdirectory $local_root]} { + set local_root [ad_file dirname $local_path/$file] + if {![ad_file isdirectory $local_root]} { file mkdir $local_root } file rename -force -- $fn $local_path/$file # # Remove potentially stale gzip file. # - if {[file exists $local_path/$file.gz]} { + if {[ad_file exists $local_path/$file.gz]} { file delete $local_path/$file.gz } @@ -4779,7 +4779,7 @@ error "download from $url failed: $result" } } - set file [file tail $url] + set file [ad_file tail $url] file rename -force -- $fn $local_path/$file } } Index: openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl,v diff -u -r1.21.2.3 -r1.21.2.4 --- openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 26 Dec 2019 14:44:08 -0000 1.21.2.3 +++ openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 13 Jul 2020 12:02:33 -0000 1.21.2.4 @@ -26,7 +26,7 @@ foreach {package_key version} [array get installed_versions] { lappend files {*}[lmap f [apm_get_package_files \ -package_key $package_key] { - if {[file extension $f] ne ".tcl"} continue + if {[ad_file extension $f] ne ".tcl"} continue set f $startdir/$package_key/$f }] } @@ -53,7 +53,7 @@ } { # couple of local helper procs proc ::tcl_p {file} { - return [expr {[string match {*.tcl} $file] || [file isdirectory $file]}] + return [expr {[string match {*.tcl} $file] || [ad_file isdirectory $file]}] } # if startdir is not $::acs::rootdir/packages, then somebody checked in the wrong thing by accident @@ -169,7 +169,7 @@ set db [apm_guess_db_type $package $file] if {[string is space $db] || $db eq $db_type} { - set tail [file tail $file] + set tail [ad_file tail $file] if {[regexp {\-(.*)-(.*).sql} $tail match v1 v2]} { set v1s [apm_version_sortable $v1] set v2s [apm_version_sortable $v2] @@ -259,7 +259,7 @@ regexp {(.*)[.]xql$} $file match base - if {![file exists ${base}.tcl] && ![file exists ${base}.vuh]} { + if {![ad_file exists ${base}.tcl] && ![ad_file exists ${base}.vuh]} { # the file did not exist so we must have a -db extension... regexp {(.*?)(-)?([A-Za-z_]*)[.]xql$} $file match base dummy db @@ -298,8 +298,8 @@ foreach xql [array names allxql] { # check there is a corresponding .tcl file - if {![file exists ${xql}.tcl] - && ![file exists ${xql}.vuh]} { + if {![ad_file exists ${xql}.tcl] + && ![ad_file exists ${xql}.vuh]} { # JCD: Hack to exclude calendar/www/views which is the only current file which has # no associated Tcl file. if {[string first calendar/www/views $allxql($xql)] < 0} { @@ -350,7 +350,7 @@ foreach {package_key version} [array get installed_versions] { lappend files {*}[lmap f [apm_get_package_files \ -package_key $package_key] { - if {[file extension $f] ne ".tcl"} continue + if {[ad_file extension $f] ne ".tcl"} continue set f $startdir/$package_key/$f }] } @@ -427,7 +427,7 @@ -package_key $package_key \ -file_types {content_page include_page}] { # Ignore non .tcl files - if {[file extension $f] ne ".tcl"} continue + if {[ad_file extension $f] ne ".tcl"} continue # Ignore docs if { "$package_key" eq "acs-core-docs" } continue set f $startdir/$package_key/$f Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.180.2.40 -r1.180.2.41 --- openacs-4/packages/xowiki/xowiki.info 17 Jun 2020 18:50:58 -0000 1.180.2.40 +++ openacs-4/packages/xowiki/xowiki.info 13 Jul 2020 12:02:33 -0000 1.180.2.41 @@ -59,7 +59,7 @@ - + Index: openacs-4/packages/xowiki/resources/templates/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/oacs-view.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/oacs-view.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/oacs-view.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/oacs-view2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/oacs-view2.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/oacs-view2.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/oacs-view2.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/oacs-view3-bootstrap3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/oacs-view3-bootstrap3.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/oacs-view3-bootstrap3.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/oacs-view3-bootstrap3.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/oacs-view3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/oacs-view3.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/oacs-view3.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/oacs-view3.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/view-book-no-ajax.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-book-no-ajax.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/view-book-no-ajax.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/view-book-no-ajax.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/view-book.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-book.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/view-book.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/view-book.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/view-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-default.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/view-default.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/view-default.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/view-links.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-links.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/view-links.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/view-links.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - +
Index: openacs-4/packages/xowiki/resources/templates/view-plain-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-plain-master.adp,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/xowiki/resources/templates/view-plain-master.adp 31 Jan 2020 18:01:10 -0000 1.1.2.4 +++ openacs-4/packages/xowiki/resources/templates/view-plain-master.adp 13 Jul 2020 12:02:33 -0000 1.1.2.5 @@ -1,4 +1,4 @@ - + @context;literal@ @item_id;literal@ Index: openacs-4/packages/xowiki/resources/templates/view-plain.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/resources/templates/view-plain.adp,v diff -u -r1.5.2.5 -r1.5.2.6 --- openacs-4/packages/xowiki/resources/templates/view-plain.adp 26 Jan 2020 18:05:58 -0000 1.5.2.5 +++ openacs-4/packages/xowiki/resources/templates/view-plain.adp 13 Jul 2020 12:02:33 -0000 1.5.2.6 @@ -1,4 +1,4 @@ - +
Index: openacs-4/packages/xowiki/tcl/adp-generator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/adp-generator-procs.tcl,v diff -u -r1.51.2.3 -r1.51.2.4 --- openacs-4/packages/xowiki/tcl/adp-generator-procs.tcl 26 Jan 2020 17:53:57 -0000 1.51.2.3 +++ openacs-4/packages/xowiki/tcl/adp-generator-procs.tcl 13 Jul 2020 12:02:33 -0000 1.51.2.4 @@ -105,8 +105,8 @@ # Generate the ADP file, when does not exist, or when the # generator is newer. # - if {![file exists $adpFilename] - || [file mtime [info script]] > [file mtime $adpFilename]} { + if {![ad_file exists $adpFilename] + || [file mtime [info script]] > [ad_file mtime $adpFilename]} { try { set f [open $adpFilename w] } on error {errorMsg} { Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.284.2.108 -r1.284.2.109 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 1 Jul 2020 19:31:58 -0000 1.284.2.108 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 13 Jul 2020 12:02:33 -0000 1.284.2.109 @@ -1761,7 +1761,7 @@ fn ${:value} { regsub -all {\\+} $fn {/} fn ;# fix IE upload path - set fn [::file tail ./$fn] ;# prefix $fn to avoid potential tilde expansion + set fn [ad_file tail $fn] set file_object [:store_file \ -file_name $fn \ Index: openacs-4/packages/xowiki/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/notification-procs.tcl,v diff -u -r1.23.2.1 -r1.23.2.2 --- openacs-4/packages/xowiki/tcl/notification-procs.tcl 10 Mar 2019 21:12:28 -0000 1.23.2.1 +++ openacs-4/packages/xowiki/tcl/notification-procs.tcl 13 Jul 2020 12:02:33 -0000 1.23.2.2 @@ -133,7 +133,7 @@ # non-wiki links. Here we are able to provide an accurate # pretty_link as base-url. # - set html [ad_html_qualify_links -path [file dirname $pretty_link] $html] + set html [ad_html_qualify_links -path [ad_file dirname $pretty_link] $html] if {![info exists text]} { set text [ad_html_text_convert -from text/html -to text/plain -- $html] Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.332.2.55 -r1.332.2.56 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 17 Jun 2020 21:25:07 -0000 1.332.2.55 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 13 Jul 2020 12:02:33 -0000 1.332.2.56 @@ -1402,7 +1402,7 @@ set fn [acs_root_dir]/$tmpl #ns_log notice "=== check get_adp_template $fn" - if {[file readable $fn.adp]} { + if {[ad_file readable $fn.adp]} { set result [::template::themed_template $tmpl] #ns_log notice "template is <$result>" if {$result ne ""} { Index: openacs-4/packages/xowiki/tcl/resource-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/resource-init.tcl,v diff -u -r1.3.2.9 -r1.3.2.10 --- openacs-4/packages/xowiki/tcl/resource-init.tcl 7 May 2020 11:02:51 -0000 1.3.2.9 +++ openacs-4/packages/xowiki/tcl/resource-init.tcl 13 Jul 2020 12:02:33 -0000 1.3.2.10 @@ -28,9 +28,9 @@ # set resDir $::acs::rootdir/packages/xowiki/www/resources foreach variant {yui bootstrap3} { - if {![file exists $resDir/xowiki-$variant.css] - || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki.css] - || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki-$variant-specific.css] + if {![ad_file exists $resDir/xowiki-$variant.css] + || [ad_file mtime $resDir/xowiki-$variant.css] < [ad_file mtime $resDir/xowiki.css] + || [ad_file mtime $resDir/xowiki-$variant.css] < [ad_file mtime $resDir/xowiki-$variant-specific.css] } { set content "" set F [open $resDir/xowiki.css]; append content [read $F] \n; close $F Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.147.2.11 -r1.147.2.12 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 1 Jul 2020 19:31:58 -0000 1.147.2.11 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 13 Jul 2020 12:02:33 -0000 1.147.2.12 @@ -194,7 +194,7 @@ # ns_guesstype was failing, which should not be the case with # recent versions of NaviServer # - switch [file extension $fn] { + switch [ad_file extension $fn] { .xotcl {set mime text/plain} .mp3 {set mime audio/mpeg} .cdf {set mime application/x-netcdf} @@ -218,7 +218,7 @@ if {[$data istype ::xowiki::PodcastItem] && $duration eq "" && [$data exists import_file]} { set filename [expr {[$data exists full_file_name] ? [$data full_file_name] : [$data set import_file]}] set ffmpeg [::$package_id get_parameter "ffmpeg" "/usr/bin/ffmpeg"] - if {[file exists $ffmpeg]} { + if {[ad_file exists $ffmpeg]} { catch {exec $ffmpeg -i $filename} output if {[info exists output]} { regexp {Duration: +([0-9:.]+)[ ,]} $output _ duration 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 -r1.57.2.12 -r1.57.2.13 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 3 May 2020 17:17:18 -0000 1.57.2.12 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 13 Jul 2020 12:02:33 -0000 1.57.2.13 @@ -106,7 +106,7 @@ && [info commands ::util::which] ne ""} { set clamscanCmd [::util::which clamdscan] foreach fn $fns { - if {$clamscanCmd ne "" && [file readable $fn]} { + if {$clamscanCmd ne "" && [ad_file readable $fn]} { if {[catch {exec $clamscanCmd $fn 2>@1} result]} { ns_log warning "[self] virus found:\n$result" return 1 Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.368.2.60 -r1.368.2.61 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 1 Jul 2020 19:31:58 -0000 1.368.2.60 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 13 Jul 2020 12:02:33 -0000 1.368.2.61 @@ -735,11 +735,11 @@ error "invalid geometry $geometry" } set tmpdir [ad_tmpdir] - if {![file isdirectory $tmpdir/$geometry]} { + if {![ad_file isdirectory $tmpdir/$geometry]} { file mkdir $tmpdir/$geometry } set scaled_image $tmpdir/$geometry/${:revision_id} - if {![file readable $scaled_image]} { + if {![ad_file readable $scaled_image]} { set cmd [::util::which convert] if {$cmd ne ""} { if {![catch {exec $cmd -geometry $geometry -interlace None -sharpen 1x2 \ @@ -751,7 +751,7 @@ return $scaled_image } } - set modtime [file mtime $full_file_name] + set modtime [ad_file mtime $full_file_name] set cmptime [ns_set iget [ns_conn headers] If-Modified-Since] if {$cmptime ne ""} { if {[clock scan $cmptime] >= $modtime} { Index: openacs-4/packages/xowiki/tcl/yui-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/yui-init.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/xowiki/tcl/yui-init.tcl 18 May 2018 09:28:49 -0000 1.2 +++ openacs-4/packages/xowiki/tcl/yui-init.tcl 13 Jul 2020 12:02:34 -0000 1.2.2.1 @@ -49,7 +49,7 @@ -urn urn:ad:css:yui2:treeview/assets/menu/tree \ -resource /resources/ajaxhelper/yui/treeview/assets/menu/tree.css -if {[file isdirectory $::acs::rootdir/packages/ajaxhelper/www/resources]} { +if {[ad_file isdirectory $::acs::rootdir/packages/ajaxhelper/www/resources]} { foreach path $YUI_CSS_PATHS { template::register_urn \ Index: openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl,v diff -u -r1.15.2.9 -r1.15.2.10 --- openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl 14 Feb 2020 13:42:12 -0000 1.15.2.9 +++ openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl 13 Jul 2020 12:02:34 -0000 1.15.2.10 @@ -450,7 +450,7 @@ www/prototypes/announcements.page www/admin/regression_test.tcl } { - if {[file exists $dir/$file]} { + if {[ad_file exists $dir/$file]} { ns_log notice "Deleting obsolete file $dir/$file" file delete -- $dir/$file } Index: openacs-4/packages/xowiki/www/admin/samples/ajax-chat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/samples/ajax-chat.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/xowiki/www/admin/samples/ajax-chat.tcl 20 Dec 2019 16:32:27 -0000 1.8.2.1 +++ openacs-4/packages/xowiki/www/admin/samples/ajax-chat.tcl 13 Jul 2020 12:02:34 -0000 1.8.2.2 @@ -22,7 +22,7 @@ set title "Import XoWiki Pages" set context {} set msg [::xowiki::Page import -objects ::xowiki::tmp::ajax-chat -replace true] -template::set_file "[file dirname $__adp_stub]/../importmsg" +template::set_file "[ad_file dirname $__adp_stub]/../importmsg" ad_return_template # Local variables: Index: openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl,v diff -u -r1.10.2.3 -r1.10.2.4 --- openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 1 Jul 2020 19:31:58 -0000 1.10.2.3 +++ openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 13 Jul 2020 12:02:34 -0000 1.10.2.4 @@ -27,7 +27,7 @@ ns_log notice "upload_image: uploaded filename <$file_name>" set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] set mime_type [::xowiki::guesstype $file_name] - set tmp_size [file size $upload_tmpfile] + set tmp_size [ad_file size $upload_tmpfile] if {$size ne ""} {exec convert -resize $size $upload_tmpfile $upload_tmpfile} if {![regexp (image/*|audio/mpeg|application/x-shockwave-flash|application/vnd.adobe.flash-movie|video/mp4) $mime_type]} { Index: openacs-4/packages/xowiki/www/portlets/include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/include.tcl,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/xowiki/www/portlets/include.tcl 7 Aug 2017 23:48:31 -0000 1.10 +++ openacs-4/packages/xowiki/www/portlets/include.tcl 13 Jul 2020 12:02:34 -0000 1.10.2.1 @@ -1,7 +1,7 @@ #ns_log notice "--including_page= $__including_page, portlet=$portlet" set content [$__including_page include $portlet] #set header_stuff [::xo::Page header_stuff] -template::set_file [file dirname $__adp_stub]/plain-include +template::set_file [ad_file dirname $__adp_stub]/plain-include # Local variables: # mode: tcl Index: openacs-4/packages/xowiki/www/xinha/attach-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/attach-file.tcl,v diff -u -r1.6.2.2 -r1.6.2.3 --- openacs-4/packages/xowiki/www/xinha/attach-file.tcl 1 Jul 2020 19:31:58 -0000 1.6.2.2 +++ openacs-4/packages/xowiki/www/xinha/attach-file.tcl 13 Jul 2020 12:02:34 -0000 1.6.2.3 @@ -61,7 +61,7 @@ set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { + if { $folder_size+[ad_file size ${upload_file.tmpfile}] > $maximum_folder_size } { template::form::set_error upload_form upload_file \ [_ file-storage.out_of_space] break Index: openacs-4/packages/xowiki/www/xinha/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/file-selector.tcl,v diff -u -r1.21.2.5 -r1.21.2.6 --- openacs-4/packages/xowiki/www/xinha/file-selector.tcl 1 Jul 2020 19:31:58 -0000 1.21.2.5 +++ openacs-4/packages/xowiki/www/xinha/file-selector.tcl 13 Jul 2020 12:02:34 -0000 1.21.2.6 @@ -153,7 +153,7 @@ set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { + if { $folder_size+[ad_file size ${upload_file.tmpfile}] > $maximum_folder_size } { template::form::set_error upload_form upload_file \ [_ file-storage.out_of_space] break Index: openacs-4/packages/xowiki/www/xinha/insert-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-file.tcl,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/xowiki/www/xinha/insert-file.tcl 1 Jul 2020 19:31:58 -0000 1.7.2.2 +++ openacs-4/packages/xowiki/www/xinha/insert-file.tcl 13 Jul 2020 12:02:34 -0000 1.7.2.3 @@ -50,7 +50,7 @@ set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"] if { $maximum_folder_size ne "" } { - if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } { + if { $folder_size+[ad_file size ${upload_file.tmpfile}] > $maximum_folder_size } { template::form::set_error upload_form upload_file \ [_ file-storage.out_of_space] break