Skip to content

Commit

Permalink
Merge pull request #68 from umr-lops/bugfix
Browse files Browse the repository at this point in the history
`move` operation will work on devices that are differents.
  • Loading branch information
agrouaze authored Feb 26, 2024
2 parents 2ff68a7 + 23d3f9b commit b239951
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cdsodatacli/download.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pdb
import subprocess

import requests
import logging
from tqdm import tqdm
Expand Down Expand Up @@ -134,7 +136,9 @@ def CDS_Odata_download_one_product_v2(
elapsed_time = time.time() - t0
if status == 200: # means OK download
speed = total_length / elapsed_time
shutil.move(output_filepath_tmp, output_filepath)
# shutil.move(output_filepath_tmp, output_filepath)
status = subprocess.check_output('mv '+output_filepath_tmp+' '+output_filepath,shell=True)
logging.debug('move status: %s',status)
os.chmod(output_filepath, mode=0o0775)
logging.debug("time to download this product: %1.1f sec", elapsed_time)
logging.debug("average download speed: %1.1fMo/sec", speed)
Expand Down

0 comments on commit b239951

Please sign in to comment.