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 @@ ...@@ -9,7 +9,7 @@
"Meadow" : { "Meadow" : {
"REMARKS" : { "REMARKS" : {
"HOWTO" : "These parameters are optional. When setting them, move them out of the REMARKS section at the same time", "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" "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, "CleanupTempDirectoryKilledWorkers" : 0,
......
...@@ -76,6 +76,7 @@ use strict; ...@@ -76,6 +76,7 @@ use strict;
use warnings; use warnings;
use POSIX; use POSIX;
use File::Path 'make_path'; use File::Path 'make_path';
use File::Spec;
use Bio::EnsEMBL::Hive::AnalysisStats; use Bio::EnsEMBL::Hive::AnalysisStats;
use Bio::EnsEMBL::Hive::Limiter; use Bio::EnsEMBL::Hive::Limiter;
...@@ -927,15 +928,16 @@ sub set_log_directory_name { ...@@ -927,15 +928,16 @@ sub set_log_directory_name {
Title : set_temp_directory_name Title : set_temp_directory_name
Description : Generates and sets the name of a temporary directory suitable for this worker. 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 It will be under the base directory requested by $base_temp_dir, or the standard
otherwise, and includes worker attributes to make the path unique. location otherwise (as advised by File::Spec), and includes worker attributes
to make the path unique.
=cut =cut
sub set_temp_directory_name { sub set_temp_directory_name {
my ($self, $base_temp_dir) = @_; my ($self, $base_temp_dir) = @_;
$base_temp_dir //= '/tmp'; $base_temp_dir //= File::Spec->tmpdir();
my $temp_directory_name; my $temp_directory_name;
if ($self->adaptor) { 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