1
0

mark 'blockchain_headers' file as sparse on windows

based on fyookball/electrum@647a6cc26d
This commit is contained in:
SomberNight
2018-09-19 22:09:54 +02:00
parent 855a70bc66
commit cedd518aea
2 changed files with 12 additions and 1 deletions

View File

@@ -383,6 +383,16 @@ def android_check_data_dir():
return data_dir
def ensure_sparse_file(filename):
# On modern Linux, no need to do anything.
# On Windows, need to explicitly mark file.
if os.name == "nt":
try:
os.system('fsutil sparse setflag "{}" 1'.format(filename))
except Exception as e:
print_error('error marking file {} as sparse: {}'.format(filename, e))
def get_headers_dir(config):
return android_headers_dir() if 'ANDROID_DATA' in os.environ else config.path