You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OMJulia starts an omc process that writes to stdout.log and stderr.log. When an additional process starts or the previous OMJulia session wasn't closed correctly I have to restart Julia to close and remove these files.
withenv("OPENMODELICAHOME"=> omhome) do
this.omcprocess =open(pipeline(`$ompath$args2$args3$args4`, stdout="stdout.log", stderr="stderr.log"))
end
Suggested Changes
Write to unique IO streams in memory for each OMJulia session. IOBuffer is breaking on Windows and isn't save to use, see JuliaLang/julia#39311.
Using undocumented Base.BufferStream() seems to work, though:
out = Base.BufferStream()
err = Base.BufferStream()
trywithenv("OPENMODELICAHOME"=> omhome) do
this.omcprocess =open(pipeline(`$ompath$args2$args3$args4`, stdout=out, stderr=err))
end# stdout = read(out, String)catch e
println(read(err, String))
rethrow(e)
finallyclose(out)
close(err)
end
Versions 'n stuff
OpenModelica: v1.22.0-dev-285-gf718aa4020-cmake
OS: Windows 11
Julia v1.9.2
The text was updated successfully, but these errors were encountered:
I tried to use Base.BufferStream() but it seems to get stuck on read(outStream, String). Maybe because the omc process isn't stopped at this point.
Maybe related to JuliaLang/julia#46869
I'll just remove the logging. I added it for debugging purpose, but if this breaks the Windows version of OMJulia there is no point in debugging it anyway.
Issue Description
OMJulia starts an omc process that writes to
stdout.log
andstderr.log
. When an additional process starts or the previous OMJulia session wasn't closed correctly I have to restart Julia to close and remove these files.Suggested Changes
Write to unique IO streams in memory for each OMJulia session.
IOBuffer
is breaking on Windows and isn't save to use, see JuliaLang/julia#39311.Using undocumented
Base.BufferStream()
seems to work, though:Versions 'n stuff
The text was updated successfully, but these errors were encountered: