Hey,
Been having a bit of trouble adapting a perl script that we have that creates a .call file and was wondering if anyone could lend a quick hand.
Now i'm trying to move the temp file from /tmp to /var but its not having it at all and from a bit of googling it looks as though its because there sat on 2 different partitions.
Now I should be able to create the temp file on /var but for some reason I just can't get my head around it.
Anyone able to help out?
Cheers,
Andy
Been having a bit of trouble adapting a perl script that we have that creates a .call file and was wondering if anyone could lend a quick hand.
Code:
use File::Temp qw/ tempfile tempdir /;
use File::Copy;
my $fh = tempfile();
my ($fh, $filename) = tempfile(UNLINK => 1);
print "File handle is $fh , File name is $filename\n\n";
printf $fh "Channel: SIP/$agent\n";
printf $fh "WaitTime: 30\n";
printf $fh "Context: from_sip\n";
printf $fh "Extension: $telenum\n";
close($fh);
my $destination = "/var/spool/asterisk/outgoing".substr($filename,4).".call";
print $destination;
move($filename, $destination) or die $1;
Now i'm trying to move the temp file from /tmp to /var but its not having it at all and from a bit of googling it looks as though its because there sat on 2 different partitions.
Now I should be able to create the temp file on /var but for some reason I just can't get my head around it.
Anyone able to help out?
Cheers,
Andy