Skip to content

Commit

Permalink
Merge #54
Browse files Browse the repository at this point in the history
54: Remove nc file if it exists before creating it r=charleskawczynski a=charleskawczynski

Sometimes julia complains that I don't have permission to create the nc file (sometimes when simulations crash). This should smooth the workflow a bit.

Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
  • Loading branch information
bors[bot] and charleskawczynski committed Jul 30, 2021
2 parents 61802f5 + b8a633d commit a5a5797
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 a5a5797

Please sign in to comment.