Skip to content

Commit

Permalink
delete symlink before re-creating
Browse files Browse the repository at this point in the history
  • Loading branch information
heikoklein committed Nov 29, 2024
1 parent a399177 commit c8d3906
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions utils/SnapPy/snap4rimsterm
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,11 @@ def snap4rimsterm(rimsterm, argosrequest, basedir, ident, met_model, bitmapCompr
snapNC, basedir, ident, isotopes, bitmapCompress=bitmapCompress
)
elif oformat.text == "NetCDF":
# create a filename which can be picked up by SMS
os.symlink(snapNC, os.path.join(basedir, f"{ident}_all.nc"))
# create a filename which can be picked up by ARGOS
outfile = os.path.join(basedir, f"{ident}_all.nc")
if os.path.exists(outfile):
os.unlink(outfile) # avoid symlink exception
os.symlink(snapNC, outfile)
else:
raise Exception(f"unknown OutputFormat in request: {oformat.text}")
else:
Expand Down

0 comments on commit c8d3906

Please sign in to comment.