Commit 23c47af4 authored by Sebastien's avatar Sebastien

Gestion TMPDIR

parent 45637feb
......@@ -115,7 +115,7 @@ MAIN:
{
my $admin_mail = $O_CONF->Get('admin_mail');
my ($fh_mail, $mail_filename) = File::Temp::tempfile(UNLINK => 1);
my ($fh_mail, $mail_filename) = File::Temp::tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
print $fh_mail <<END;
Subject: [Family-Companion] New user account - $common_name
From: $admin_mail
......
......@@ -4,6 +4,7 @@ use strict;
use FindBin;
use lib "$FindBin::RealBin/../../lib/int/";
use lib "$FindBin::RealBin/../../lib/ext/lipmutils";
use File::Temp qw/ tempfile tempdir /;
use General;
......@@ -15,13 +16,13 @@ use Storable;
require 'FamilyCompanion.pl';
our $WORKDIR;
our $O_CONF;
MAIN:
{
my $o_param = New ParamParser('GETOPTLONG', \&Usage, 'workdir=s', 'start=i', 'size=i');
$o_param->AssertDirExists('workdir');
$o_param->AssertDefined('start','size');
SetGlobals();
$WORKDIR = $o_param->Get('workdir');
my $start = $o_param->Get('start');
my $size = $o_param->Get('size');
......@@ -117,7 +118,7 @@ sub SelectSequenceRepGroupe
my $selecCode = "";
my $id = 0;
my ($fh_tmp, $tmpfile) = File::Temp::tempfile(UNLINK => 1);
my ($fh_tmp, $tmpfile) = File::Temp::tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
foreach my $ra_species_seqid (@{$ra_species_seqid_list})
{
......
......@@ -259,7 +259,7 @@ sub RunBlast
}
$fh_cmd_blast->close();
$cmd = "(cat $WORKDIR/cmd.blast | parallel -j $THREADS > $WORKDIR/cmd.blast.out ) 2> $WORKDIR/cmd.blast.err";
$cmd = "(cat $WORKDIR/cmd.blast | parallel --tmpdir $WORKDIR -j $THREADS > $WORKDIR/cmd.blast.out ) 2> $WORKDIR/cmd.blast.err";
&System($cmd);
......
......@@ -140,7 +140,7 @@ sub VacuumAndAnalyze
{
my ($outdir) = @_;
&Log("VACUUM AND ANALYZE");
my ($fh_cmd, $cmdfile) = tempfile(UNLINK => 1);
my ($fh_cmd, $cmdfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
print $fh_cmd <<END;
VACUUM;
ANALYSE;
......@@ -156,7 +156,7 @@ sub __Load
my ($outdir, $tabfile, $table) = @_;
&Log("FILE - $table - $tabfile");
my ($fh_cmd, $cmdfile) = tempfile(UNLINK => 1);
my ($fh_cmd, $cmdfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
print $fh_cmd <<END;
.separator "\t"
.import $tabfile $table
......@@ -260,9 +260,9 @@ sub ParseProteomes
{
my ($rh_protein_ids, $rh_proteome_files, $rh_protein_groups) = @_;
my ($fh_proteins_tabfile, $proteins_tabfile) = tempfile(UNLINK => 1);
my ($fh_proteome_tabfile, $proteome_tabfile) = tempfile(UNLINK => 1);
my ($fh_homologyGroup_proteome_association, $homologyGroup_proteome_association) = tempfile(UNLINK => 1);
my ($fh_proteins_tabfile, $proteins_tabfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my ($fh_proteome_tabfile, $proteome_tabfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my ($fh_homologyGroup_proteome_association, $homologyGroup_proteome_association) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my $protein_id = 1;
my $proteome_id = 1;
......@@ -348,7 +348,7 @@ sub ParseHomologyGroupsResults
{
my ($homologygroups_out, $outdir) = @_;
my ($fh_homologygroups_tabfile, $homologygroups_tabfile) = tempfile(UNLINK => 1);
my ($fh_homologygroups_tabfile, $homologygroups_tabfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my $homologygroups_id = &GetNewgroupId($outdir);
if ($homologygroups_id == 0)
......
......@@ -21,7 +21,7 @@ sub SetGlobals
}
$WORKDIR = tempdir(CLEANUP => 0, DIR => $O_CONF->Get('workdir_tmp'));
$WORKDIR = tempdir(CLEANUP => 0, DIR => $O_CONF->Get('tmpdir'));
$DATE = `date "+%Y%m%d %H:%M:%S"`;
chomp $DATE;
......
......@@ -49,7 +49,7 @@ sub CreatePanProteome
}
$fh_select_cmd->close();
&System("(cat $WORKDIR/cmd.selectrep | parallel -j $THREADS > $WORKDIR/cmd.selectrep.out ) 2> $WORKDIR/cmd.selectrep.err");
&System("(cat $WORKDIR/cmd.selectrep | parallel --tmpdir $WORKDIR -j $THREADS > $WORKDIR/cmd.selectrep.out ) 2> $WORKDIR/cmd.selectrep.err");
&Log("INFO - Merge Select representative slices");
for (my $i = 0; $i < $THREADS; $i ++)
......
......@@ -62,7 +62,7 @@ sub GetOrthologousAlignments
my %h_aligned_coreproteome = ();
foreach my $rh_group (@{$ra_orthologous_groups})
{
my ($fh_tmp, $tempfile) = tempfile(UNLINK => 1);
my ($fh_tmp, $tempfile) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
foreach my $code (keys %{$rh_group})
{
my $seqid = $rh_group->{$code}->[0];
......
......@@ -165,7 +165,7 @@ sub CreateAccount
}
else
{
my ($fh_err, $err) = File::Temp::tempfile(UNLINK => 1);
my ($fh_err, $err) = File::Temp::tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my $return = system("($cmd > $err) 2> $err");
if ($return ne 0)
{
......
......@@ -446,7 +446,7 @@ sub SetAdminAccountSend
}
else
{
my ($fh_err,$err) = File::Temp::tempfile(UNLINK => 1);
my ($fh_err,$err) = File::Temp::tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
my $return = system ("($cmd > $err) 2> $err");
if ($return ne 0)
{
......
......@@ -2042,7 +2042,7 @@ sub __WSBlast
my $evalue = $$ro_param->Get('blastevalue');
my ($fh_query, $query_file) = tempfile(UNLINK => 1);
my ($fh_query, $query_file) = tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
print $fh_query uri_unescape($query);
$fh_query->close;
......
......@@ -204,7 +204,7 @@ sub SendMail
my $from = $O_CONF->Get('admin_mail');
$from = $cc if (defined $cc);
my ($fh_mail, $mail_filename) = File::Temp::tempfile(UNLINK => 1);
my ($fh_mail, $mail_filename) = File::Temp::tempfile(UNLINK => 1, DIR => $O_CONF->Get('tmpdir'));
print $fh_mail <<END;
Subject: $subject
From: $from
......
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