diff --git a/Core/src/model/utils.jl b/Core/src/model/utils.jl
index 13cdc2b0..a481964b 100644
--- a/Core/src/model/utils.jl
+++ b/Core/src/model/utils.jl
@@ -72,7 +72,12 @@ function atomic_write end
 function atomic_write(f::Function, as::Union{Type{IO}, Type{String}}, dest::AbstractString, temp::AbstractString)
     try
         if as == IO
-            open(f, temp, "w")
+            io = open(temp, "w")
+            f(io)
+            req = Libc.malloc(Base._sizeof_uv_fs)
+            @ccall uv_fs_fsync(C_NULL::Ptr{Cvoid}, req::Ptr{Cvoid}, fd(io)::Base.OS_HANDLE, C_NULL::Ptr{Cvoid})::Cint
+            Libc.free(req)
+            close(io)
         else # String
             f(temp)
         end