Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -N -r1.90.2.27 -r1.90.2.28 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 17 Feb 2022 20:19:06 -0000 1.90.2.27 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 27 Nov 2022 10:52:26 -0000 1.90.2.28 @@ -614,8 +614,7 @@ (which at least KDE also knows how to handle) } { if {$path eq ""} { - set path [ad_tmpnam] - file mkdir $path + set path [ad_mktmpdir] } db_1row select_object_metadata {} @@ -645,8 +644,7 @@ publish an object to the filesystem } { if {$path eq ""} { - set path [ad_tmpnam] - file mkdir $path + set path [ad_mktmpdir] } db_1row select_object_metadata {} Index: openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl,v diff -u -N -r1.10.2.19 -r1.10.2.20 --- openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 9 Sep 2022 13:03:10 -0000 1.10.2.19 +++ openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 27 Nov 2022 10:52:26 -0000 1.10.2.20 @@ -26,9 +26,8 @@ fetch first 1 rows only } - set tmp_filename [ad_tmpnam] set content "This is a test file" - set wfd [open $tmp_filename w] + set wfd [ad_opentmpfile tmp_filename] puts $wfd $content close $wfd @@ -542,8 +541,7 @@ aa_true "add form was returned" {[llength $form] > 2} set file_name "I am not a tmpfile" - set notmpfile [ad_tmpnam] - set wfd [open $notmpfile w] + set wfd [ad_opentmpfile notmpfile] puts $wfd "I am not a real tmpfile!" close $wfd set notmpfile_checksum [ns_md file $notmpfile] Index: openacs-4/packages/file-storage/tcl/test/webtest-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/test/Attic/webtest-procs.tcl,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/file-storage/tcl/test/webtest-procs.tcl 31 Aug 2022 22:41:13 -0000 1.1.2.13 +++ openacs-4/packages/file-storage/tcl/test/webtest-procs.tcl 27 Nov 2022 10:52:26 -0000 1.1.2.14 @@ -101,8 +101,7 @@ # A 'real' simulation would actually upload a file via # multipart request, but this is enough for testing. - set tmpfile [ad_tmpnam] - set wfd [open $tmpfile w] + set wfd [ad_opentmpfile tmpfile] puts $wfd 1234 close $wfd Index: openacs-4/packages/file-storage/www/download-zip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/download-zip.tcl,v diff -u -N -r1.9.2.14 -r1.9.2.15 --- openacs-4/packages/file-storage/www/download-zip.tcl 4 Feb 2022 15:07:43 -0000 1.9.2.14 +++ openacs-4/packages/file-storage/www/download-zip.tcl 27 Nov 2022 10:52:26 -0000 1.9.2.15 @@ -31,8 +31,7 @@ set user_id [ad_conn user_id] # copy all files together in a temporary folder on the filesystem - set in_path [ad_tmpnam] - file mkdir $in_path + set in_path [ad_mktmpdir] foreach fs_object_id $object_id { fs::publish_object_to_file_system \ Index: openacs-4/packages/file-storage/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-add.tcl,v diff -u -N -r1.28.2.6 -r1.28.2.7 --- openacs-4/packages/file-storage/www/file-add.tcl 24 Aug 2022 08:58:59 -0000 1.28.2.6 +++ openacs-4/packages/file-storage/www/file-add.tcl 27 Nov 2022 10:52:26 -0000 1.28.2.7 @@ -187,8 +187,7 @@ ad_script_abort } - set path [ad_tmpnam] - file mkdir $path + set path [ad_mktmpdir] if {[catch { exec $unpack_binary -jd $path ${upload_file.tmpfile} } errMsg]} { # @@ -224,8 +223,7 @@ } # create a temporary file to import from user entered HTML set mime_type text/html - set tmp_filename [ad_tmpnam] - set fd [open $tmp_filename w] + set fd [ad_opentmpfile tmp_filename] puts $fd $content_body close $fd set upload_files [list $title] Index: openacs-4/packages/file-storage/www/folder-zip-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-zip-add.tcl,v diff -u -N -r1.11.2.10 -r1.11.2.11 --- openacs-4/packages/file-storage/www/folder-zip-add.tcl 18 Feb 2022 12:56:48 -0000 1.11.2.10 +++ openacs-4/packages/file-storage/www/folder-zip-add.tcl 27 Nov 2022 10:52:26 -0000 1.11.2.11 @@ -171,8 +171,7 @@ # # Create temp directory to unzip. # - set unzip_path [ad_tmpnam] - file mkdir $unzip_path + set unzip_path [ad_mktmpdir] # # Unzip. Index: openacs-4/packages/oacs-dav/tcl/tDAV-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/oacs-dav/tcl/tDAV-procs.tcl,v diff -u -N -r1.19.2.5 -r1.19.2.6 --- openacs-4/packages/oacs-dav/tcl/tDAV-procs.tcl 25 Sep 2022 20:54:41 -0000 1.19.2.5 +++ openacs-4/packages/oacs-dav/tcl/tDAV-procs.tcl 27 Nov 2022 10:52:26 -0000 1.19.2.6 @@ -780,8 +780,7 @@ proc tdav::filter_webdav_put {args} { - set tmpfile [ad_tmpnam] - set fd [open $tmpfile w+] + set fd [ad_opentmpfile tmpfile] ns_writecontent $fd close $fd