Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make tmpdir/homedir functional
  • Loading branch information
lizmat committed Feb 14, 2015
1 parent 6c86e26 commit 301cf15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/io_operators.pm
Expand Up @@ -226,17 +226,19 @@ sub indir(Str() $path, &what, Str() $CWD = $*CWD) {
}

sub tmpdir(Str() $path, Str() $CWD = $*CWD) {
my $newTMPDIR := CHANGE-DIRECTORY($path,$*TMPDIR.Str,&FILETEST-rwx);
my $newTMPDIR := CHANGE-DIRECTORY($path,$CWD,&FILETEST-rwx);
return $newTMPDIR if nqp::istype($newTMPDIR,Failure);

$*TMPDIR; # make sure we have a PROCESS:: one
$*TMPDIR = $newTMPDIR;
True;
}

sub homedir(Str() $path, Str() $CWD = $*CWD) {
my $newHOME := CHANGE-DIRECTORY($path,$*HOME.Str,&FILETEST-rwx);
my $newHOME := CHANGE-DIRECTORY($path,$CWD,&FILETEST-rwx);
return $newHOME if nqp::istype($newHOME,Failure);

$*HOME; # make sure we have a PROCESS:: one
$*HOME = $newHOME;
True;
}
Expand Down

0 comments on commit 301cf15

Please sign in to comment.