Skip to content

Commit

Permalink
Remove nc file if it exists before creating it
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 29, 2021
1 parent 61802f5 commit bf3e597
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NetCDFIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ mutable struct NetCDFIO_Stats
cinterior = Gr.cinterior
finterior = Gr.finterior

# Remove the NC file if it exists, in case it accidentally wasn't closed
isfile(path_plus_file) && rm(path_plus_file; force=true)

Dataset(path_plus_file, "c") do root_grp

zf = Gr.z[finterior]
Expand Down

0 comments on commit bf3e597

Please sign in to comment.