From e569c673e8b79b1805b290cdef8c557c511f42d1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 30 Sep 2016 20:00:13 +0200 Subject: temporary directory instead of file --- hel/recv-media.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index 67dded55..0be20d0c 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -13,8 +13,10 @@ writeScriptBin "recv-media" '' PATH=${coreutils}/bin dir=/var/media + tmpFile="''${dir}"/.tmp/$(basename "$1") target="''${dir}"/$(basename "$1") - tmpFile=$(${coreutils}/bin/mktemp --dry-run --tmpdir=''${dir} .recv-media.XXXXXXXXXX) + + mkdir -pv $(basename "''${tmpFile}") ${eject}/bin/ionice -c 3 -t cp -vn --preserve=all "$1" ''${tmpFile} && mv -v ''${tmpFile} "''${target}" touch -c -m -t "$2" "''${target}" -- cgit v1.2.3