Only pre-allocate up to 5MB from big files
This commit is contained in:
parent
b1575a979e
commit
1296ab9b60
1 changed files with 1 additions and 1 deletions
|
@ -389,7 +389,7 @@ class SiteStoragePlugin(object):
|
||||||
os.makedirs(file_dir)
|
os.makedirs(file_dir)
|
||||||
|
|
||||||
f = open(file_path, 'wb')
|
f = open(file_path, 'wb')
|
||||||
f.truncate(size)
|
f.truncate(min(1024 * 1024 * 5, size)) # Only pre-allocate up to 5MB
|
||||||
f.close()
|
f.close()
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
startupinfo = subprocess.STARTUPINFO()
|
startupinfo = subprocess.STARTUPINFO()
|
||||||
|
|
Loading…
Reference in a new issue