From e40f4b9bde2317e1a1794950b3a2d81f67b754a4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 19 Oct 2017 10:12:24 -0700 Subject: [PATCH] dir: Use .casengine-* temporary directories Tool-specific filenames make tool-specific cleanup easier. If a casengine dir handler crashes or is abandoned without the Close() cleanup, this lets you clean up after it with: $ rm -rf /path/to/base/.casengine-* or similar without having to worry about blowing away non-casengine content. More discussion about this use-case and alternative approaches in [1]. [1]: https://github.com/openSUSE/umoci/pull/198 Signed-off-by: W. Trevor King --- dir/dir.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dir/dir.go b/dir/dir.go index 8566c29..2ba4c5b 100644 --- a/dir/dir.go +++ b/dir/dir.go @@ -84,7 +84,7 @@ func (r *RegexpGetDigest) GetDigest(path string) (dig digest.Digest, err error) // New creates a new CAS-engine instance. func New(ctx context.Context, path string, uri string, getDigest GetDigest) (engine casengine.Engine, err error) { - temp, err := ioutil.TempDir(path, "tmp-") + temp, err := ioutil.TempDir(path, ".casengine-") if err != nil { return nil, err }