It is not unusual for apps to output files that have no content, i.e. have length zero. Currently, the API throws the following exception when trying to download empty files:
File size is 0. Refusing to download.
While it is not difficult to work around this problem like shown below, it would be more convenient if the API tolerated downloading empty files.
def download_file(f, path):
print("Downloading '%s' to '%s'" % (f.name, path))
try:
f.download(path, wait=True)
except SbgError as e:
if e.message == "File size is 0. Refusing to download.":
open(path, 'a').close()
else:
raise e
It is not unusual for apps to output files that have no content, i.e. have length zero. Currently, the API throws the following exception when trying to download empty files:
While it is not difficult to work around this problem like shown below, it would be more convenient if the API tolerated downloading empty files.