From ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 16 Dec 2022 19:50:28 -0300 Subject: bin/z: Use $TMPDIR: allow z(1) to work on non-writable directories --- bin/z | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bin/z') diff --git a/bin/z b/bin/z index 0558436..30ce8ce 100755 --- a/bin/z +++ b/bin/z @@ -95,8 +95,7 @@ sub arg_for($arg) { my $type = trim `file -i $_`; if (any { $type eq $_ } keys %TYPES) { - my $template = File::Basename::basename $arg . '.XXXXXX'; - my ($fh, $tmpname) = File::Temp::tempfile(TEMPLATE => $template); + my ($fh, $tmpname) = File::Temp::tempfile(); push @tmpfiles, $tmpname; my @command = @{$TYPES{$type}}; print $fh `@command $arg`; -- cgit v1.2.3