diff --git a/wcs/qommon/storage.py b/wcs/qommon/storage.py index 9851d1525..2be65ff29 100644 --- a/wcs/qommon/storage.py +++ b/wcs/qommon/storage.py @@ -51,7 +51,9 @@ def atomic_write(path, content, async=False): '''Rewrite a complete file automatically, that is write to new file with temporary name, fsync, then rename to final name. Use threads to remove blocking.''' def doit(): - fd, temp = tempfile.mkstemp(dir=os.path.dirname(path), prefix=os.path.basename(path)) + dirname = os.path.dirname(path) + fd, temp = tempfile.mkstemp(dir=dirname, + prefix='.tmp-'+os.path.basename(path)+'-') f = os.fdopen(fd, "w") if hasattr(content, 'read'): # file pointer