mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 22:17:54 +00:00
parallel: tmpfile now returns only a filehandle if in scalar context.
This commit is contained in:
parent
bd38a6ac54
commit
5829f512c1
16
src/parallel
16
src/parallel
|
@ -3898,7 +3898,15 @@ sub tmpfile {
|
||||||
# Returns:
|
# Returns:
|
||||||
# $filehandle = opened file handle
|
# $filehandle = opened file handle
|
||||||
# $filename = file name created
|
# $filename = file name created
|
||||||
return ::tempfile(DIR=>$ENV{'TMPDIR'}, TEMPLATE => 'parXXXXX', @_);
|
my($filehandle,$filename) =
|
||||||
|
::tempfile(DIR=>$ENV{'TMPDIR'}, TEMPLATE => 'parXXXXX', @_);
|
||||||
|
if(wantarray) {
|
||||||
|
return($filehandle,$filename);
|
||||||
|
} else {
|
||||||
|
# Separate unlink due to NFS dealing badly with File::Temp
|
||||||
|
unlink $filename;
|
||||||
|
return $filehandle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub tmpname {
|
sub tmpname {
|
||||||
|
@ -4092,10 +4100,7 @@ sub multiply_binary_prefix {
|
||||||
# Returns:
|
# Returns:
|
||||||
# N/A
|
# N/A
|
||||||
if(not $disk_full_fh) {
|
if(not $disk_full_fh) {
|
||||||
my $name;
|
$disk_full_fh = ::tmpfile(SUFFIX => ".df");
|
||||||
($disk_full_fh, $name) = ::tmpfile(SUFFIX => ".df");
|
|
||||||
# Separate unlink due to NFS dealing badly with File::Temp
|
|
||||||
unlink $name;
|
|
||||||
$b8193 = "x"x8193;
|
$b8193 = "x"x8193;
|
||||||
}
|
}
|
||||||
# Linux does not discover if a disk is full if writing <= 8192
|
# Linux does not discover if a disk is full if writing <= 8192
|
||||||
|
@ -4251,6 +4256,7 @@ sub which {
|
||||||
%pid_parentpid_cmd =
|
%pid_parentpid_cmd =
|
||||||
(
|
(
|
||||||
'aix' => $sysv,
|
'aix' => $sysv,
|
||||||
|
'android' => $sysv,
|
||||||
'cygwin' => $sysv,
|
'cygwin' => $sysv,
|
||||||
'darwin' => $bsd,
|
'darwin' => $bsd,
|
||||||
'dec_osf' => $sysv,
|
'dec_osf' => $sysv,
|
||||||
|
|
Loading…
Reference in a new issue