0001-qommon-storage-in-_atomic_write-do-not-create-temp-f.patch
wcs/qommon/storage.py | ||
---|---|---|
51 | 51 |
'''Rewrite a complete file automatically, that is write to new file with |
52 | 52 |
temporary name, fsync, then rename to final name. Use threads to remove blocking.''' |
53 | 53 |
def doit(): |
54 |
fd, temp = tempfile.mkstemp(dir=os.path.dirname(path), prefix=os.path.basename(path)) |
|
54 |
dirname = os.path.dirname(path) |
|
55 |
fd, temp = tempfile.mkstemp(dir=dirname, |
|
56 |
prefix='.tmp-'+os.path.basename(path)+'-') |
|
55 | 57 |
f = os.fdopen(fd, "w") |
56 | 58 |
if hasattr(content, 'read'): |
57 | 59 |
# file pointer |
58 |
- |