diff options
author | EuAndreh <eu@euandre.org> | 2022-12-16 19:50:28 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-12-16 19:50:28 -0300 |
commit | ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0 (patch) | |
tree | fb3f3d4a5b09bb9583d0972cb81871e66b7cb688 | |
parent | etc/sh/rc: Add _POSIX_C_SOURCE to $CFLAGS by default (diff) | |
download | dotfiles-ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0.tar.gz dotfiles-ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0.tar.xz |
bin/z: Use $TMPDIR: allow z(1) to work on non-writable directories
-rwxr-xr-x | bin/z | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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`; |