From a087517308e15c18048ef81b7e0101c20fcd4095 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 21 Sep 2026 16:30:59 -0500 Subject: [PATCH] Make the course archive file created from the file manager not contain the temporary directory. When I switched the course archive created from the file manager to offering the created archive for download instead of storing in the course's directory, I used a temporary directory created inside the course directory. However, that results in that temporary directory being included in the archive. So this switches to using a temporary directory created in webwork's main temporary directory `$webworkDirs{tmp}`. --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm index 29eb4d9bc1..df13762f7a 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -49,7 +49,7 @@ sub pre_header_initialize ($c) { # Note that it is important that the tempDir is a property on the controller so that it stays in scope as long # as the controller does, i.e., until the request is rendered. Otherwise the temporary directory will be # automatically removed before the archive file is rendered, and an empty file will be offered for download. - $c->{tempDir} = eval { tempdir('archive.XXXX', DIR => "$ce->{webworkDirs}{courses}/$courseID") }; + $c->{tempDir} = eval { tempdir('archive.XXXX', DIR => $ce->{webworkDirs}{tmp}) }; if ($@) { $c->addbadmessage($c->maketext('Unable to created temporary directory for course archive: [_1]', $@)); } else {