From c730da3b9ddc3ed5e53d42644e9fbd5d6a6daca6 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Thu, 14 Jun 2018 08:18:33 +0200 Subject: [PATCH] Use environment variables to find the tmp directory --- src/ec_file.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ec_file.erl b/src/ec_file.erl index 7d89ace..9637529 100644 --- a/src/ec_file.erl +++ b/src/ec_file.erl @@ -277,9 +277,15 @@ remove_recursive(Path, Options) -> tmp() -> case erlang:system_info(system_architecture) of "win32" -> - "./tmp"; + case os:getenv("TEMP") of + false -> "./tmp"; + Val -> Val + end; _SysArch -> - "/tmp" + case os:getenv("TMPDIR") of + false -> "/tmp"; + Val -> Val + end end. %% Copy the subfiles of the From directory to the to directory.