Commit 4a3ccd30 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

File::Spec is wiser at chosing a temp directory

parent 55229eb8
......@@ -9,7 +9,7 @@
"Meadow" : {
"REMARKS" : {
"HOWTO" : "These parameters are optional. When setting them, move them out of the REMARKS section at the same time",
"BaseTempDirectory" : "Where to create temporary directories for workers. When null or missing, workers will use /tmp",
"BaseTempDirectory" : "Where to create temporary directories for workers. When null or missing, workers will ask File::Spec, which choses $TMPDIR or /tmp",
"RunWorkerPath" : "The path of runWorker.pl . When null or missing, beekeeper will use $EHIVE_ROOT_DIR or its own path. When RunWorkerPath is '', beekeeper assumes runWorker.pl is in $PATH"
},
"CleanupTempDirectoryKilledWorkers" : 0,
......
......@@ -76,6 +76,7 @@ use strict;
use warnings;
use POSIX;
use File::Path 'make_path';
use File::Spec;
use Bio::EnsEMBL::Hive::AnalysisStats;
use Bio::EnsEMBL::Hive::Limiter;
......@@ -927,15 +928,16 @@ sub set_log_directory_name {
Title : set_temp_directory_name
Description : Generates and sets the name of a temporary directory suitable for this worker.
It will be under the base directory requested by $base_temp_dir, or /tmp
otherwise, and includes worker attributes to make the path unique.
It will be under the base directory requested by $base_temp_dir, or the standard
location otherwise (as advised by File::Spec), and includes worker attributes
to make the path unique.
=cut
sub set_temp_directory_name {
my ($self, $base_temp_dir) = @_;
$base_temp_dir //= '/tmp';
$base_temp_dir //= File::Spec->tmpdir();
my $temp_directory_name;
if ($self->adaptor) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment